Skip to content

[Bug] API /embeddings rarely seems to work #9128

Closed

Description

@noah-schroeder

name: Unsloth Studio Bug
about: Report a problem with the Unsloth Studio desktop app or web UI
title: "[Studio Bug] "
labels: bug
assignees: ""

Environment

Where are you using Unsloth?

  • Studio desktop application
  • Studio web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version:
Pop!OS 22.04

GPU model(s) and accelerator backend:
Nvidia Cuda

Versions:
v.01.800-beta

What happened?

Trying to use embeddings via API. Consistently see: {"error":{"code":501,"message":"This server does not support embeddings. Start it with --embeddings","type":"not_supported_error"}}

Tried adding --embeddings via the model settings, but it says its "managed by unsloth studio and cannot be passed here"

Steps to reproduce:

  1. try to call an embedding model (i'm using llama-embed-nemotron-8b-GGUF)
  2. watch it fail :)

Expected behavior:
/embeddings should be a valid endpoint for the API by default, or at least have a toggle to enable it.

Actual behavior:
/embeddings doesn't seem to exist

Model and operation involved:
unsloth/Qwen3-Embedding-4B and mradermacher/llama-embed-nemotron-8b-GGUF and both fail with same error.
Consistently see: {"error":{"code":501,"message":"This server does not support embeddings. Start it with --embeddings","type":"not_supported_error"}}

Diagnostics and logs

don't have one readily available - its super easy to reproduce

Desktop application

Click Copy Diagnostics on the error, startup, or update screen and paste the
result below:

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

Activity

  1. added
    feature request
    on Aug 17, 2026
  2. self-assigned this
    on Aug 17, 2026
  3. Souravrajvi0 commented on Aug 18, 2026

    @Souravrajvi0
    Contributor

    @NilayYadav — took a pass at this in #9149.

    Root cause: Studio only added --embedding when the GGUF header had pooling_type (MEAN/CLS/LAST). Models like Qwen3-Embedding / nomic-bert often omit that, so llama-server started in chat mode and /v1/embeddings 501'd.

    Fix: Fall back to architecture + model-name detection (e.g. nomic-bert, llama-embed, Qwen3-Embedding) when pooling_type is absent. Explicit NONE/RANK in the header still wins.

    Verified: Reproduced the 501 without --embedding, got HTTP 200 + embeddings with it (CPU, nomic-embed-text-v1.5). Unit tests pass.

    If this approach looks right to you, would appreciate a look when you have a moment.

  4. 3-ark commented on Aug 19, 2026

    @3-ark
    Error generating embeddings for batch starting at index 0: 404 Not Found {"error":{"message":"The model 'UNSLOTH-bge-m3/bge-m3-q8_0' is not downloaded on this server. Available models: LFM2.5-2.6B, LFM2.5-2.6B/LFM2.5-2.6B-Q8_0, LFM2.5-VL-3B-heretic, LFM2.5-VL-3B-heretic/LFM2.5-VL-3B-heretic-Q8_0, Qwen3.6-35B-A3B-uncensored-heretic, Qwen3.6-35B-A3B-uncensored-heretic/Qwen3.6-35B-A3B-uncensored-heretic-Q4_K_M, bartowski/Ling-3.0-tiny-GGUF, bge-m3 and 9 more. Download more in Unsloth Studio, or list them with GET /v1/models.","type":"not_found_error","param":"model","code":"model_not_found"}}
    

    I don't know if my situation related, I call embedding from my front end by /v1/embeddings, and as you can see, the embedding model bge-m3 can't be loaded like other chat models. while I can load the model manually and embed it.

  5. Souravrajvi0 commented on Aug 19, 2026

    @Souravrajvi0
    Contributor

    @3-ark — thanks for reporting this. I don't think it's the same bug as the original 501.

    The original issue is llama-server starting without --embedding (Studio only flipped that on when the GGUF header had pooling_type). That's what #9149 addresses.

    Your error is a 404 model_not_found: the request names UNSLOTH-bge-m3/bge-m3-q8_0, but Studio's catalog doesn't have that id. From the message, the downloaded model is listed as bge-m3 (and similar aliases from GET /v1/models). Auto-switch won't load a name it can't resolve, even if you can load bge-m3 by hand in Studio and embed successfully.

    Could you try calling /v1/embeddings with a model id from GET /v1/models — e.g. bge-m3 — rather than the UNSLOTH-bge-m3/... prefix? If that works, this is a client/alias mismatch, not the missing --embedding path. If you still get a 501 after using a listed id, that's the original bug and #9149 should cover it.

  6. 3-ark commented on Aug 19, 2026

    @3-ark

    Could you try calling /v1/embeddings with a model id from GET /v1/models — e.g. bge-m3 — rather than the UNSLOTH-bge-m3/... prefix? If that works, this is a client/alias mismatch, not the missing --embedding path. If you still get a 501 after using a listed id, that's the original bug and #9149 should cover it.

    Great catch! Thanks, you are right about that ID mismatch. But I have to test it later since I need to change some code then. I checked LM Studio where I could active models, the id was right there. So It's positive that the bug is from my side, thanks very much.

    Here is something I think you didn't pay attention but could be some minor issues:
    There is a redundant ID issue I guess, I call either one even they have different model name/id, i will paste all the screenshots so you can have a look.

    Image Image
  7. Souravrajvi0 commented on Aug 19, 2026

    @Souravrajvi0
    Contributor

    Thanks @3-ark for the follow-up and screenshots — that helps clarify things.

    Your 404 was a client/alias mismatch (calling UNSLOTH-bge-m3/bge-m3-q8_0 instead of an id from GET /v1/models, e.g. bge-m3). Glad that lines up with LM Studio on your side.

    The redundant IDs in your screenshots are a separate catalog/UX issue, not the original 501 bug:

    • The model picker can list both a folder (bge-m3) and a sibling standalone .gguf (bge-m3-q8_0) from the same custom folder scan.
    • The API monitor echoes whatever model the client sends on /embeddings (e.g. UNSLOTH-bge-m3), while the load row shows the resolved public id (bge-m3:q8_0).

    The 501 fix (llama-server not starting with --embedding when pooling_type is missing) is in #9149 and pending merge.

    Follow-up: I'm opening a small PR to dedupe custom-folder entries and show the resolved public id in the API monitor for embeddings, so the picker and monitor stay consistent with GET /v1/models.

  8. Souravrajvi0 commented on Aug 19, 2026

    @Souravrajvi0
    Contributor

    Follow-up PR for the redundant-ID / monitor cleanup: #9306 (dedupes custom-folder folder + loose .gguf entries, normalizes API monitor ids). The 501 fix remains in #9149.

  9. added a commit that references this issue on Aug 24, 2026
    785a68d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfeature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions