[PR #3406] [MERGED] Add raw provider endpoints #5921

Closed
opened 2026-10-23 04:05:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3406
Author: @kaldigo
Created: 7/9/2026
Status: ✅ Merged
Merged: 7/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/raw-provider-endpoints


📝 Commits (2)

  • 9326093 Add raw provider endpoints
  • e00bbc2 Merge branch 'staging' into codex/raw-provider-endpoints

📊 Changes

2 files changed (+456 additions, -0 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+2 -0)
➕ packages/server/src/routes/generate/raw-route.ts (+454 -0)

📄 Description

Linked issue

Closes #3405

Why this change

Extensions sometimes need small, non-mutating model utility calls without going through Marinara's chat generation pipeline. /api/generate/dryRun is useful for previewing assembled chat prompts, but it still requires chat context and prompt assembly.

This adds explicit raw provider endpoints for extension workflows such as style checks, scoring, classification, lightweight text transformation, and embedding lookup.

What changed

  • Added POST /api/generate/raw for explicit raw chat messages through a saved connection.
  • Added POST /api/generate/raw/abort for aborting in-flight raw generation.
  • Added POST /api/generate/raw/embeddings for non-mutating embeddings through a saved connection's configured embedding source.
  • Registered the raw route under /api/generate.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran pnpm --config.verify-deps-before-run=false check.
  • Ran pnpm --config.verify-deps-before-run=false version:check.
  • Ran pnpm --config.verify-deps-before-run=false guard:installer-artifacts.
  • Started a local dev app with isolated DATA_DIR on port 7861.
  • Added an Ollama-compatible custom connection.
  • Verified POST /api/generate/raw prompt preview returns only explicit raw messages.
  • Verified POST /api/generate/raw returns a non-streaming response.
  • Verified streaming raw generation emits raw_started, token, result, and done.
  • Verified active raw abort returns { "aborted": true } from both the abort endpoint and original request.
  • Verified POST /api/generate/raw/embeddings returns a 768-dimensional vector using the connection's configured embedding model.
  • Verified missing connection and invalid message role error paths.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Not applicable; this is server API-only.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/3406 **Author:** [@kaldigo](https://github.com/kaldigo) **Created:** 7/9/2026 **Status:** ✅ Merged **Merged:** 7/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/raw-provider-endpoints` --- ### 📝 Commits (2) - [`9326093`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9326093be2bc188ece95b7e6d8f2c5f857c61385) Add raw provider endpoints - [`e00bbc2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e00bbc2514e788f95ff4982d4e17f40f9a250ea6) Merge branch 'staging' into codex/raw-provider-endpoints ### 📊 Changes **2 files changed** (+456 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+2 -0) ➕ `packages/server/src/routes/generate/raw-route.ts` (+454 -0) </details> ### 📄 Description ## Linked issue Closes #3405 ## Why this change Extensions sometimes need small, non-mutating model utility calls without going through Marinara's chat generation pipeline. `/api/generate/dryRun` is useful for previewing assembled chat prompts, but it still requires chat context and prompt assembly. This adds explicit raw provider endpoints for extension workflows such as style checks, scoring, classification, lightweight text transformation, and embedding lookup. ## What changed - Added `POST /api/generate/raw` for explicit raw chat messages through a saved connection. - Added `POST /api/generate/raw/abort` for aborting in-flight raw generation. - Added `POST /api/generate/raw/embeddings` for non-mutating embeddings through a saved connection's configured embedding source. - Registered the raw route under `/api/generate`. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran `pnpm --config.verify-deps-before-run=false check`. - Ran `pnpm --config.verify-deps-before-run=false version:check`. - Ran `pnpm --config.verify-deps-before-run=false guard:installer-artifacts`. - Started a local dev app with isolated `DATA_DIR` on port `7861`. - Added an Ollama-compatible custom connection. - Verified `POST /api/generate/raw` prompt preview returns only explicit raw messages. - Verified `POST /api/generate/raw` returns a non-streaming response. - Verified streaming raw generation emits `raw_started`, `token`, `result`, and `done`. - Verified active raw abort returns `{ "aborted": true }` from both the abort endpoint and original request. - Verified `POST /api/generate/raw/embeddings` returns a 768-dimensional vector using the connection's configured embedding model. - Verified missing connection and invalid message role error paths. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Not applicable; this is server API-only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:05:10 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5921
No description provided.