unsloth/studio/backend/routes
Roland Tannous 92cee0ff3e
Studio: support images on /v1/messages (Anthropic-compat) (#5128)
* Studio: support images on /v1/messages (Anthropic-compat)

Translate Anthropic `image` content blocks (base64 and url sources) to
OpenAI `image_url` multimodal parts so the Anthropic endpoint reaches
llama-server's native vision path. Mirrors the `/v1/chat/completions`
vision behavior: 400 when the active GGUF isn't a vision model, and
embedded images are re-encoded to PNG (stb_image format coverage).
Server-side agentic loop is disabled when images are present, matching
the existing `not image_b64` gate on /v1/chat/completions.

Adds translator + normalizer unit tests.

* Studio: address gemini-code-assist review on /v1/messages image support

- Preserve interleaving of Anthropic text + image content blocks in the
  translator (previously flattened all text first, then all images).
- Let _normalize_anthropic_openai_images return has_image so the route
  skips the second scan it was doing.
- Use module-level base64/io in the helper instead of re-importing.
2026-04-22 03:25:07 +04:00
..
data_recipe Let recipes use the model loaded in Chat (#4840) 2026-04-08 03:48:22 -07:00
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00
auth.py Studio: Expose openai and anthropic compatible external API end points (#4956) 2026-04-13 21:08:11 +04:00
datasets.py studio: show HF model download progress in training start overlay (#4894) 2026-04-14 08:54:01 -07:00
export.py studio: stream export worker output into the export dialog (#4897) 2026-04-14 08:55:43 -07:00
inference.py Studio: support images on /v1/messages (Anthropic-compat) (#5128) 2026-04-22 03:25:07 +04:00
models.py Studio: Ollama support, recommended folders, Custom Folders UX polish (#5050) 2026-04-16 08:24:08 -07:00
training.py [Studio] multi gpu finetuning/inference via "balanced_low0/sequential" device_map (#4602) 2026-03-30 02:33:15 -07:00
training_history.py feat(studio): training history persistence and past runs viewer (#4501) 2026-03-25 00:58:55 -07:00