provider::llamacpp::abort
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
- request_idstringrequired
- abortedbooleanrequired
llama.cpp server (llama-server) Chat Completions provider worker; implements provider::llamacpp::stream and provider::llamacpp::refresh_models behind llm-router.
exact versions are immutable; binary and bundle artifacts are digest-pinned.
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
Count prompt tokens for {model, system_prompt?, tools?, messages} through the llama-server's own count endpoint, using the loaded model's tokenizer; never runs the model and costs nothing.
Wire agent messages, the same shape `provider::llamacpp::stream` accepts. Must be non-empty.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.
Model id the prompt targets. `llama-server` serves one model at a time and counts with whichever it loaded, so this is carried for the reply rather than to select a tokenizer.
System prompt counted as the leading wire message when present.
Function invocation schemas; mapped to the wire `tools` array.
Always `metered`: the server that holds the model produced the count.
Prompt tokens the server counted with the loaded model's tokenizer.
Batch text embeddings via the configured llama-server's /v1/embeddings (requires --embeddings and an embedding-capable model). One vector per input, order preserved. Fully local; credential only when the server runs with --api-key.
Texts to embed, one vector returned per input, order preserved.
Model name passed through to the server. llama-server embeds with its loaded model regardless; the field is echoed for parity with the other providers.
One embedding per input, in input order.
Internal: router::ready subscriber that re-declares this provider and refreshes its catalog.
Discover the resolved llama.cpp server's live model catalog (GET /v1/models + /props) and reconcile it through the router; returns the model count written.
Stream a llama.cpp server chat completion: resolve credentials (optional — most local servers run with no --api-key), call the upstream Chat Completions API, and relay AssistantMessageEvent frames to writer_ref.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.