Skip to content

fix: keep llama.cpp embedding inputs as text - #317

Merged
mpekatsoula merged 1 commit into
arm:mainfrom
atirna:fix/llamacpp-raw-embeddings
Sep 1, 2026
Merged

fix: keep llama.cpp embedding inputs as text#317
mpekatsoula merged 1 commit into
arm:mainfrom
atirna:fix/llamacpp-raw-embeddings

Conversation

@atirna

@atirna atirna commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

llama.cpp embedding servers can reject token-ID payloads from OpenAIEmbeddings. Sending the original text avoids the Prompt contains invalid tokens error for models such as nomic-embed-text-v1.5.

Change

  • Set llama.cpp's embedding default to send raw text.
  • Keep the existing OpenAI-compatible default unchanged; provider configuration can still override the default where token IDs are supported.

Verification

  • pytest -q
  • pre-commit run --files src/metis/providers/openai_compatible.py src/metis/providers/llamacpp.py tests/test_openai_compatible_provider.py

Fixes #247

@mpekatsoula
mpekatsoula merged commit fa46783 into arm:main Sep 1, 2026
7 checks passed
@atirna
atirna deleted the fix/llamacpp-raw-embeddings branch September 1, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provider Embedding Model Regression: Prompt Contains Invalid Tokens

2 participants