Skip to content

b316

Choose a tag to compare

@github-actions github-actions released this 04 Sep 20:53
9e6cc5c

serve: add /api/embed, /api/create, /api/copy, /api/blobs; fix 415, 501 (#403)

Integrating llmman into ~100 Ollama-API clients kept hitting the same
gaps. Each fix follows ollama's server/routes.go and llm/llama_server.go.

Embeddings: /api/embed and /api/embeddings ride on the backend's
/v1/embeddings with ollama's semantics (truncate, dimensions, keep_alive,
bounded fan-out, NaN/Inf rejection). An embedding model is detected by
its GGUF pooling_type key and loaded with --embeddings and a per-slot
batch, which also fixes the 501 /v1/embeddings gave.

Model management: /api/copy is llmman cp over the wire. /api/create
supports from (alias) and files (GGUFs uploaded via /api/blobs, built
like llmman build); Modelfile fields are refused with a 400 naming
them. A loaded model whose tag now points elsewhere is evicted.

Content-Type: the Ollama routes accept a JSON body under any header, as
gin's ShouldBindJSON does, instead of a 415. A cross-site non-JSON POST
from an origin CORS wouldn't allow is refused (it skips preflight).

Also fixes llmman cp/build storing a bare destination verbatim while
run/rm/show resolve one to docker.io/ai/, so cp gemma4 mine && run mine never worked.