Skip to content

fix(studio): auto-enable --embedding for GGUFs missing pooling_type - #9149

Merged
Imagineer99 merged 11 commits into
unslothai:mainfrom
Souravrajvi0:feat/fix-embeddings-api-9128-cd10
Aug 24, 2026
Merged

Imagineer99 merged 11 commits into
unslothai:mainfrom
Souravrajvi0:feat/fix-embeddings-api-9128-cd10

Conversation

@Souravrajvi0

Copy link
Copy Markdown
Contributor

Summary

Fixes #9128

Studio only launched llama-server with --embedding when a GGUF header declared a sequence pooling type (MEAN/CLS/LAST). Many embedding models omit that field, so /v1/embeddings returned 501:

{"error":{"code":501,"message":"This server does not support embeddings. Start it with `--embeddings`"}}

This adds architecture/name-based detection as a fallback when pooling_type is absent, while still respecting explicit NONE/RANK header values.

Changes

  • gguf_metadata.py: detect dedicated embedding architectures (nomic-bert, llama-embed, etc.) and embedding model name hints
  • llama_cpp.py: extend is_embedding_gguf to use the fallback probe
  • inference.py: pass model identifier into the embedding GGUF probe

Test plan

  • pytest tests/test_embedding_gguf_launch.py tests/test_gguf_metadata.py -k embedding (24 passed)
  • Reproduced 501 without --embedding on nomic-embed-text-v1.5 (CPU)
  • Verified HTTP 200 + 768-dim embeddings with --embedding (CPU)
  • Synthetic Qwen3-Embedding / nomic-bert GGUFs without pooling_type now classify as embedding models

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

danielhanchen commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Confirmed this hits llama_cpp.py where is_embedding_gguf still keys only off pooling_type, so GGUFs that omit it never launch with --embedding.

@Imagineer99 Imagineer99 self-assigned this Aug 19, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 19, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 0c45b4ddb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Imagineer99

Copy link
Copy Markdown
Member

ran a deterministic A/B with the related tests
A old code 27 failed 285 passed
B current head all 312 passed
same tests and deps with only production code swapped so this looks solid

@danielhanchen

Copy link
Copy Markdown
Member

Re-checked at the current head and the fallback does cover the header-less GGUFs from the report, but "bert" in GGUF_EMBEDDING_ARCHITECTURES means a reranker is kept out only by a "rerank" substring in its name, which is the exact case the old refusal guarded. Could you gate the generic bert arch on something intrinsic rather than the name list?

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@Imagineer99

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8f33e7c3e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Imagineer99

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: de91b6490b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Imagineer99

Copy link
Copy Markdown
Member

reviewed and approved 131 tests green and the real GGUF A/B shows the fix passes and revert reproduces good to merge

@Imagineer99
Imagineer99 merged commit 785a68d into unslothai:main Aug 24, 2026
44 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] API /embeddings rarely seems to work

3 participants