[GH-ISSUE #780] [Feature]: Bridge the gap between Local Sidecar and Embedding Connections #376

Closed
opened 2026-10-20 17:28:09 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @vanta-jack on GitHub (May 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/780

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Currently, there is a significant "UX Cliff" when setting up local embeddings. While the GUI makes it easy to install the llama-cpp runtime and download a model (like Nomic v1.5), the app does not automatically "bridge" this model to the rest of the system.

The pain points are:

  1. Manual Discovery: Users must manually search server logs to find the random port assigned to the Sidecar just to create a "dummy" OpenAI connection.
  2. Android Barrier: On Android/Termux, the default `all-MiniLM-L6-v2` local embedder is disabled due to `onnxruntime` compatibility. This makes the Sidecar the only local option for Android users, yet it is the hardest one to configure.
  3. Friction: Having a "Ready" local model that isn't selectable in the "Embedding Connection" dropdown feels like a broken feature to non-technical users.

Proposed solution

I would like to see a more integrated "One-Click" flow for local embeddings:

  1. Stable Internal Proxy: Implement a proxied route at `/api/sidecar/v1/embeddings` (and potentially `/chat/completions`) that automatically routes to the currently active Sidecar process, regardless of its dynamic port.
  2. Connection Discovery: Add "Sidecar" as a first-class option in the Embedding Connection dropdown in the Connection Editor.
  3. Auto-Configuration: If the Sidecar is running an embedding-capable model (like Nomic or BGE), provide a UI hint or button to "Set as Active Embedding Source" for Lorebooks and Memory Recall.

Alternatives considered

  • Manual Pinning: Users can manually add `SIDECAR_PORT=8080` to their `.env` and create a manual OpenAI connection. This works but requires CLI knowledge and is not "plug-and-play."
  • Remote APIs: Using OpenAI/NIM for embeddings works but defeats the purpose of the Local AI sidecar for users with privacy or connectivity concerns.

Additional context

  • Android limitation: `packages/server/src/services/local-embedder.ts` explicitly disables local embeddings on Android.
  • Sidecar logic: `packages/server/src/routes/sidecar.routes.ts` handles management but currently lacks a pass-through proxy for the underlying `llama-server` API.
  • User Experience: Bridging this gap would fulfill the promise of a "Zero-Config" local AI experience for mobile users.

Template check

  • I DID NOT read this template and provide the requested details.

Transparency Note:
This request was written by my AI development agent (Gemini CLI) on my behalf based on the specific friction points we encountered while setting up Nomic as a local embedding model on a Samsung Galaxy A50s (Termux). I have reviewed the technical research and confirmed that the proposed proxy solution would resolve the manual configuration overhead.

Originally created by @vanta-jack on GitHub (May 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/780 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Currently, there is a significant "UX Cliff" when setting up local embeddings. While the GUI makes it easy to install the llama-cpp runtime and download a model (like Nomic v1.5), the app does not automatically "bridge" this model to the rest of the system. **The pain points are:** 1. **Manual Discovery:** Users must manually search server logs to find the random port assigned to the Sidecar just to create a "dummy" OpenAI connection. 2. **Android Barrier:** On Android/Termux, the default \`all-MiniLM-L6-v2\` local embedder is disabled due to \`onnxruntime\` compatibility. This makes the Sidecar the *only* local option for Android users, yet it is the hardest one to configure. 3. **Friction:** Having a "Ready" local model that isn't selectable in the "Embedding Connection" dropdown feels like a broken feature to non-technical users. ## Proposed solution I would like to see a more integrated "One-Click" flow for local embeddings: 1. **Stable Internal Proxy:** Implement a proxied route at \`/api/sidecar/v1/embeddings\` (and potentially \`/chat/completions\`) that automatically routes to the currently active Sidecar process, regardless of its dynamic port. 2. **Connection Discovery:** Add "Sidecar" as a first-class option in the **Embedding Connection** dropdown in the Connection Editor. 3. **Auto-Configuration:** If the Sidecar is running an embedding-capable model (like Nomic or BGE), provide a UI hint or button to "Set as Active Embedding Source" for Lorebooks and Memory Recall. ## Alternatives considered - **Manual Pinning:** Users can manually add \`SIDECAR_PORT=8080\` to their \`.env\` and create a manual OpenAI connection. This works but requires CLI knowledge and is not "plug-and-play." - **Remote APIs:** Using OpenAI/NIM for embeddings works but defeats the purpose of the Local AI sidecar for users with privacy or connectivity concerns. ## Additional context - **Android limitation:** \`packages/server/src/services/local-embedder.ts\` explicitly disables local embeddings on Android. - **Sidecar logic:** \`packages/server/src/routes/sidecar.routes.ts\` handles management but currently lacks a pass-through proxy for the underlying \`llama-server\` API. - **User Experience:** Bridging this gap would fulfill the promise of a "Zero-Config" local AI experience for mobile users. ## Template check - [ ] I DID NOT read this template and provide the requested details. --- **Transparency Note:** This request was written by my AI development agent (Gemini CLI) on my behalf based on the specific friction points we encountered while setting up Nomic as a local embedding model on a Samsung Galaxy A50s (Termux). I have reviewed the technical research and confirmed that the proposed proxy solution would resolve the manual configuration overhead.
Author
Owner

@cha1latte commented on GitHub (May 14, 2026):

Triage note: labeling this as scope-risk because the Sidecar embedding bridge solves a real Android/local-embedding setup problem, but the proposed solution spans proxy routing, connection discovery, and auto-configuration across client, server, and Android behavior.

The least risky next step is to split the work into a first-class Sidecar embedding connection slice before adding broader one-click automation.

<!-- gh-comment-id:4454557936 --> @cha1latte commented on GitHub (May 14, 2026): Triage note: labeling this as `scope-risk` because the Sidecar embedding bridge solves a real Android/local-embedding setup problem, but the proposed solution spans proxy routing, connection discovery, and auto-configuration across client, server, and Android behavior. The least risky next step is to split the work into a first-class Sidecar embedding connection slice before adding broader one-click automation.
Author
Owner

@SpicyMarinara commented on GitHub (May 17, 2026):

Reasonable, implementing.

<!-- gh-comment-id:4470040265 --> @SpicyMarinara commented on GitHub (May 17, 2026): Reasonable, implementing.
Author
Owner

@SpicyMarinara commented on GitHub (May 17, 2026):

Implemented on staging in eadbdd8a. Local Model sidecar can now be selected as an embedding source from connection settings, lorebook vectorization can use the synthetic sidecar source, memory recall resolves that source server-side, and /api/sidecar/v1/embeddings exposes a stable sidecar embedding endpoint.

<!-- gh-comment-id:4470316478 --> @SpicyMarinara commented on GitHub (May 17, 2026): Implemented on staging in eadbdd8a. Local Model sidecar can now be selected as an embedding source from connection settings, lorebook vectorization can use the synthetic sidecar source, memory recall resolves that source server-side, and /api/sidecar/v1/embeddings exposes a stable sidecar embedding endpoint.
Author
Owner

@vanta-jack commented on GitHub (May 17, 2026):

oh my god thank you so much for implementing this! finally makes it easier to do embedding on Termux environment!

<!-- gh-comment-id:4471251177 --> @vanta-jack commented on GitHub (May 17, 2026): oh my god thank you so much for implementing this! finally makes it easier to do embedding on Termux environment!
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#376
No description provided.