Skip to main content

Module routes

Module routes 

Source
Expand description

Every path ferrox-server serves, named once.

Only routes that actually exist belong here. A constant for a not-yet-implemented endpoint is worse than no constant at all: it reads as a promise, and a client that imports it gets a 404 with the contract crate’s blessing.

Constants§

ADMIN_DOWNLOAD
Fetch a .gguf from the Hugging Face Hub into the model directory. Answers 202 with a task id.
ADMIN_MODELS
Model inventory: what is on disk, what is loaded, what failed.
ADMIN_MODELS_LOAD
Start loading a discovered model by its id. Answers 202 with a task id; the load itself runs off the request.
ADMIN_MODELS_UNLOAD
Drop the active model. Synchronous: unloading is releasing one Arc, and requests already decoding keep theirs.
ADMIN_STATS
Counters, uptime, and the recent-request ring buffer.
ADMIN_TASKS
Every long-running job this server knows about, newest first.
ADMIN_TASK_CANCEL
Request cancellation of one task. A template, not a literal: the {task_id} placeholder is written in the OpenAPI style rather than any one web framework’s, because this crate is imported by clients that have never heard of the server’s router. Build a concrete path with admin_task_cancel.
ALL
Every fixed route above, for clients that want to enumerate the surface (and for the round-trip test below).
CACHE_STATS
Response- and prefix-cache counters.
HEALTH
Liveness + readiness + capability handshake. Never behind auth, so a probe works regardless of FERROX_API_KEY.
METRICS
Prometheus text-exposition metrics.
V1_CANCEL
Explicit cancellation of one in-flight generation, by the request_id the server states on the first streamed chunk.
V1_CHAT_COMPLETIONS
V1_COMPLETIONS
V1_DETOKENIZE
V1_EMBEDDINGS
V1_MESSAGES
Anthropic-compatible messages endpoint.
V1_MODELS
V1_STREAM
Reconnect into a stream started with stream_resumable: true, resuming after the Last-Event-ID the client last saw.
V1_STREAM_POLL
The same replay buffer over plain JSON, for the case SSE cannot survive: a reverse proxy that buffers text/event-stream turns a stream into one long silence, and cannot do that to a short response that has already ended. Build a concrete path with v1_stream_poll.
V1_TOKENIZE

Functions§

admin_task_cancel
The concrete cancel path for one task id.
v1_stream
The concrete resume path for one request id.
v1_stream_poll
The concrete polling-fallback path for one request id.