[GH-ISSUE #2863] [Feature]: Enhanced parameter control for sidecar llama-server deployment to support lorebook semantic search. #1451

Closed
opened 2026-10-21 05:35:26 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @hendrix2222 on GitHub (Jun 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2863

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Out of the box, you cannot use the Gemma 4 sidecar for lorebook embedding/vectorization. Two issues arise:

  1. The default sidecar pooling type is 'none':
"type":"Error","message":"Local sidecar embedding request failed (400): Pooling type 'none' is not OAI compatible. Please use a different pooling type"
  1. The default sidecar batch size is 512:
E srv    send_error: task id = 5, error: input (660 tokens) is too large to process. increase the physical batch size (current batch size: 512)

This error can occur when entries being vectorized exceed a certain size.

Both of these issues can be resolve by adjusting the command line parameters passed to llama-server that is backing the sidecar model.

--pooling mean --ubatch 1024

However, these parameters are currently passed as hardcoded values in the sidecar launch plan:
args.push("--embeddings", "--pooling", "none");

Proposed solution

Provide additional configuration items that can override the default values above when starting the sidecar llama-server

Alternatives considered

Provide ability to select overrides in the sidecar configuration window.

Additional context

Errors above can be triggered by:

  1. Create a lorebook with n number of entries.
  2. Use the lorebook configuration window to enable semantic search and select the sidecar in the available model drop down.
  3. Click the button to vectorize the entries in the lorebook.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @hendrix2222 on GitHub (Jun 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2863 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Out of the box, you cannot use the Gemma 4 sidecar for lorebook embedding/vectorization. Two issues arise: 1. The default sidecar pooling type is 'none': ``` "type":"Error","message":"Local sidecar embedding request failed (400): Pooling type 'none' is not OAI compatible. Please use a different pooling type" ``` 2. The default sidecar batch size is 512: ``` E srv send_error: task id = 5, error: input (660 tokens) is too large to process. increase the physical batch size (current batch size: 512) ``` This error can occur when entries being vectorized exceed a certain size. Both of these issues can be resolve by adjusting the command line parameters passed to llama-server that is backing the sidecar model. `--pooling mean --ubatch 1024` However, these parameters are currently passed as hardcoded values in the sidecar launch plan: ` args.push("--embeddings", "--pooling", "none");` ## Proposed solution Provide additional configuration items that can override the default values above when starting the sidecar llama-server ## Alternatives considered Provide ability to select overrides in the sidecar configuration window. ## Additional context Errors above can be triggered by: 1. Create a lorebook with n number of entries. 2. Use the lorebook configuration window to enable semantic search and select the sidecar in the available model drop down. 3. Click the button to vectorize the entries in the lorebook. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:35:26 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jun 27, 2026):

I'll see if Gemma supports this stuff.
https://ai.google.dev/gemma/docs/core/model_card_4

<!-- gh-comment-id:4816343433 --> @SpicyMarinara commented on GitHub (Jun 27, 2026): I'll see if Gemma supports this stuff. https://ai.google.dev/gemma/docs/core/model_card_4
Author
Owner

@SpicyMarinara commented on GitHub (Jun 27, 2026):

Implemented configurable llama.cpp embedding launch parameters for the local sidecar.

What changed:

  • Added persisted sidecar config for embedding pooling and physical batch size.
  • Exposed both in the Local Model runtime settings UI for llama.cpp runtimes.
  • Passed the settings through to llama-server as --pooling and --ubatch-size .
  • Kept defaults as pooling=None and batch size=512 so existing installs keep current behavior.

For Gemma lorebook semantic search, set:

  • Pooling Type: Mean
  • Physical Batch Size: 1024

Notes checked:

  • llama.cpp documents /v1/embeddings as requiring pooling other than none and lists pooling modes none/mean/cls/last/rank.
  • Gemma 4 docs recommend temp=1.0, top_p=0.95, top_k=64 for sampling; this issue was embedding-launch related, so I left generation defaults untouched.

Validation:

  • pnpm build:shared
  • pnpm --filter @marinara-engine/server lint
  • pnpm --filter @marinara-engine/client lint
  • git diff --check
<!-- gh-comment-id:4816540983 --> @SpicyMarinara commented on GitHub (Jun 27, 2026): Implemented configurable llama.cpp embedding launch parameters for the local sidecar. What changed: - Added persisted sidecar config for embedding pooling and physical batch size. - Exposed both in the Local Model runtime settings UI for llama.cpp runtimes. - Passed the settings through to llama-server as --pooling <mode> and --ubatch-size <size>. - Kept defaults as pooling=None and batch size=512 so existing installs keep current behavior. For Gemma lorebook semantic search, set: - Pooling Type: Mean - Physical Batch Size: 1024 Notes checked: - llama.cpp documents /v1/embeddings as requiring pooling other than none and lists pooling modes none/mean/cls/last/rank. - Gemma 4 docs recommend temp=1.0, top_p=0.95, top_k=64 for sampling; this issue was embedding-launch related, so I left generation defaults untouched. Validation: - pnpm build:shared - pnpm --filter @marinara-engine/server lint - pnpm --filter @marinara-engine/client lint - git diff --check
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#1451
No description provided.