Skip to content

[Feature] Studio API: /v1/completions support + logprobs for non-GGUF models (MLX/Transformers) #7703

Closed

Description

@dotVansh

TL;DR

Unsloth Studio's /v1/completions only works when a GGUF model is loaded. For non-GGUF backends (e.g. MLX) it returns a 503. Non-GGUF models are limited to /v1/chat/completions. This blocks a vast number of use cases, including log-likelihood-based evaluation using tools such as lm-evaluation-harness.

Reproduction

  • Start Unsloth Studio and load a non-GGUF model.
  • Request http://127.0.0.1:8888/v1/completions and optionally enable logprobs. Example:
curl http://127.0.0.1:8888/v1/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mlx-community/Qwen3.5-2B-MLX-bf16",
    "prompt": "2+2=",
    "logprobs": 3,
    "max_tokens": 16,
    "stream": false
  }'

The error message shown is:

{"error":{"message":"No GGUF model loaded. Load a GGUF model first. Or enable Model auto-switch (Settings > API) to load a requested model automatically.","type":"api_error","param":null,"code":null}}
HTTP 503

Additionally, even /v1/chat/completions rejects requests with logprobs outright, and this isn't just limited to non-GGUFs:

{"error":{"message":"logprobs is not supported for chat completions.","type":"invalid_request_error","param":"logprobs","code":"unsupported_parameter"}}
HTTP 400

Conversely, /v1/completions work perfectly against GGUF models, and also return per-token logprobs proxied from llama-server.

Activity

  1. added
    feature request
    on Jul 31, 2026
  2. dotVansh commented on Jul 31, 2026

    @dotVansh
    Author

    By the way, this issue is a prerequisite for #5867 (built-in benchmarking in Studio with lm_eval). I'm the assignee there and already have lm_eval-based benchmarking working for GGUF models through Studio.

    Log-likelihood benchmarks like MMLU and HellaSwag need support for logprobs, and many other benchmarks also rely on /v1/completions requests. Neither works for MLX/transformers models right now, so shipping benchmarks without this would limit benchmarking to GGUF only. Adding /v1/completions (and logprobs) support for non-GGUF backends would unlock benchmarking across all backends.

  3. Lyxot commented on Aug 3, 2026

    @Lyxot
    Collaborator

    I'm working on this for MLX backend

  4. dotVansh commented on Aug 3, 2026

    @dotVansh
    Author

    That’s amazing, thanks! Do let me know if I can help in any way

  5. danielhanchen commented on Oct 20, 2026

    @danielhanchen
    Member

    Fixed! Sorry on the delay. Non-GGUF models now serve /v1/completions with logprobs: MLX reports them from the model's own logits before any sampler, and /tokenize answers from a resident MLX model too, while a model running on the opt-in vLLM or SGLang engine is served by relaying to it, which handles logprobs, echo and prompt_logprobs natively. unsloth eval also gained --backend vllm for scoring with vLLM directly. That covers log-likelihood harnesses such as lm-evaluation-harness on Apple Silicon and on Linux GPUs. Two gaps remain: /v1/chat/completions still refuses logprobs, and an in-process transformers model still has no completions path.

    To update: uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir (if it's not in the current release yet it'll be in the next one). Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions