Bug
When using EMBEDDING_MODEL_CONFIG__TRANSPORT=openai with an OpenAI-compatible provider that doesn't support encoding_format=base64 (e.g., OpenRouter hosting nvidia/nemotron-3-embed-1b:free), every embedding call fails with:
ValueError: No embedding data received
Root cause
The openai Python SDK (v2.36.0) defaults to encoding_format='base64' when the parameter is not explicitly passed:
# openai/resources/embeddings.py
if not is_given(encoding_format):
params["encoding_format"] = "base64"
Honcho's src/embedding_client.py does not set encoding_format on either the single-query path (line 237) or the batch path (line 440), so the SDK sends base64 by default.
OpenRouter returns HTTP 200 but with empty embedding data for models that don't support base64 encoding. The SDK then raises ValueError("No embedding data received").
Reproduction
- Configure Honcho with
EMBEDDING_MODEL_CONFIG__MODEL=nvidia/nemotron-3-embed-1b:free on OpenRouter
- Trigger any embedding (e.g.,
create_conclusions)
- API logs show:
WARNING - Embedding batch failed (attempt 1/3), retrying in 1s: No embedding data received
ERROR - Error processing batch after all retries
Impact
create_conclusions fails silently (returns error to caller)
search_messages / semantic search fails
- Deriver fails to process queued observations
- Any model on OpenRouter (or other compatible providers) that doesn't support base64-encoded embeddings is affected
Fix
Add encoding_format='float' explicitly to both embedding call paths:
# src/embedding_client.py line 237 (single-query)
- openai_kwargs: dict[str, Any] = {"model": self.model, "input": [query]}
+ openai_kwargs: dict[str, Any] = {"model": self.model, "input": [query], "encoding_format": "float"}
# src/embedding_client.py line 440 (batch)
openai_kwargs: dict[str, Any] = {
"model": self.model,
"input": [item.text for item in batch],
+ "encoding_format": "float",
}
Environment
- Honcho v3.0.11 (commit 14538cf)
openai Python SDK v2.36.0
- Provider: OpenRouter (
https://openrouter.ai/api/v1)
- Model:
nvidia/nemotron-3-embed-1b:free
- pgvector 0.8.2, column type
halfvec(2048)
Workaround
Patch the file inside the container:
docker compose exec api sed -i \
's/{"model": self.model, "input": \[query\]}/{"model": self.model, "input": [query], "encoding_format": "float"}/' \
/app/src/embedding_client.py
Bug
When using
EMBEDDING_MODEL_CONFIG__TRANSPORT=openaiwith an OpenAI-compatible provider that doesn't supportencoding_format=base64(e.g., OpenRouter hostingnvidia/nemotron-3-embed-1b:free), every embedding call fails with:Root cause
The
openaiPython SDK (v2.36.0) defaults toencoding_format='base64'when the parameter is not explicitly passed:Honcho's
src/embedding_client.pydoes not setencoding_formaton either the single-query path (line 237) or the batch path (line 440), so the SDK sendsbase64by default.OpenRouter returns HTTP 200 but with empty embedding data for models that don't support base64 encoding. The SDK then raises
ValueError("No embedding data received").Reproduction
EMBEDDING_MODEL_CONFIG__MODEL=nvidia/nemotron-3-embed-1b:freeon OpenRoutercreate_conclusions)Impact
create_conclusionsfails silently (returns error to caller)search_messages/ semantic search failsFix
Add
encoding_format='float'explicitly to both embedding call paths:Environment
openaiPython SDK v2.36.0https://openrouter.ai/api/v1)nvidia/nemotron-3-embed-1b:freehalfvec(2048)Workaround
Patch the file inside the container: