openclaw - ✅(Solved) Fix memory-lancedb: OpenAI SDK v6.34+ defaults to encoding_format=base64, breaking local embedding providers (LM Studio, Ollama) [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72839Fetched 2026-04-28 06:31:39
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1cross-referenced ×1mentioned ×1

Error Message

With LM Studio serving nomic-embed-text-v1.5:

  • curl request without encoding_format → returns 768-dim float array ✅
  • OpenAI SDK request without explicit encoding_format → LM Studio returns 192-dim array ❌

Fix Action

Fix

Add encoding_format: "float" to the embeddings request in memory-lancedb/index.js:

async embed(text) {
    const params = {
      model: this.model,
      input: text,
      encoding_format: "float"
    };
    // ...
}

This ensures consistent behavior regardless of OpenAI SDK defaults.

PR fix notes

PR #72840: fix(memory-lancedb): add encoding_format=float to embedding requests

Description (problem / solution / changelog)

Problem

OpenAI SDK v6.34+ defaults to encoding_format=base64 for embedding requests. Local embedding providers (LM Studio, Ollama) may not handle this correctly, returning truncated vectors.

Observed behavior

With LM Studio serving nomic-embed-text-v1.5:

  • Raw HTTP request → 768-dim float array ✅
  • OpenAI SDK request (default base64) → LM Studio returns 192-dim
  • OpenAI SDK request with encoding_format: 'float'768-dim

This causes memory-lancedb recall to fail with:

No vector column found to match with the query vector dimension: 192

Fix

Explicitly set encoding_format: 'float' in the embedding request params to ensure consistent behavior regardless of OpenAI SDK version defaults.

Fixes #72839

Changed files

  • extensions/memory-lancedb/index.ts (modified, +2/-1)

Code Example

let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : "base64";

---

async embed(text) {
    const params = {
      model: this.model,
      input: text,
      encoding_format: "float"
    };
    // ...
}
RAW_BUFFERClick to expand / collapse

Problem

OpenAI SDK v6.34.0 changed the default encoding_format for embeddings from float to base64 (see openai-node PR). This breaks local embedding providers like LM Studio and Ollama that may not handle base64 encoding correctly.

Observed behavior

With LM Studio serving nomic-embed-text-v1.5:

  • curl request without encoding_format → returns 768-dim float array ✅
  • OpenAI SDK request without explicit encoding_format → LM Studio returns 192-dim array ❌

The SDK adds encoding_format: "base64" by default (see src/resources/embeddings.ts line 28-29):

let encoding_format = hasUserProvidedEncodingFormat ? body.encoding_format : "base64";

Impact

  • memory-lancedb plugin recall fails with: No vector column found to match with the query vector dimension: 192
  • Auto-recall on every message triggers this error
  • Any OpenClaw setup using local embedding providers (LM Studio, Ollama, llama.cpp) via the baseUrl config is affected

Fix

Add encoding_format: "float" to the embeddings request in memory-lancedb/index.js:

async embed(text) {
    const params = {
      model: this.model,
      input: text,
      encoding_format: "float"
    };
    // ...
}

This ensures consistent behavior regardless of OpenAI SDK defaults.

Environment

  • OpenClaw: v2026.4.15
  • OpenAI SDK: v6.34.0
  • Embedding provider: LM Studio (local)
  • Model: text-embedding-nomic-embed-text-v1.5

extent analysis

TL;DR

To fix the issue, add encoding_format: "float" to the embeddings request to ensure consistent behavior with local embedding providers.

Guidance

  • Verify that the local embedding provider (e.g., LM Studio) is configured to handle float encoding correctly.
  • Check the OpenAI SDK version to confirm it is v6.34.0, which changed the default encoding_format to base64.
  • Update the memory-lancedb/index.js file to include encoding_format: "float" in the embeddings request, as shown in the provided fix.
  • Test the fix by running a curl request and an OpenAI SDK request without explicit encoding_format to ensure both return the expected 768-dim float array.

Example

The fix involves updating the embed function in memory-lancedb/index.js to include the encoding_format parameter:

async embed(text) {
    const params = {
      model: this.model,
      input: text,
      encoding_format: "float"
    };
    // ...
}

Notes

This fix assumes that the local embedding provider (LM Studio) is correctly handling float encoding. If issues persist, verify the provider's configuration and compatibility with the OpenAI SDK.

Recommendation

Apply the workaround by adding encoding_format: "float" to the embeddings request, as this ensures consistent behavior with local embedding providers and resolves the issue caused by the OpenAI SDK's default encoding_format change.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING