Skip to main content

Module local

Module local 

Source
Expand description

Local image generation — submit a prompt straight to the engine, no studio.

Mirrors the studio job path (ws::session::run_offered_job): resolve the model’s [ModelSource] (here from the local Catalog instead of a studio offer), build a Task::Image, dispatch, and record the finished job — into the dedicated local-queue ring so it shows up in the app.

Structs§

LocalImageRequest
A local image-generation request. Optional fields fall back to the model’s CLI defaults from the catalog.

Enums§

LocalError
Why a local generation could not run.

Functions§

chat_on_lane
Serve a chat on the lane of a loaded model, recording it like any local job. None when the resolved model is not loaded (or is not a chat model): the caller runs it as a transient job instead.
resolve_llm
The chat model a request names, or the default one: it must exist and be an LLM.
run_image
Run one local image job: resolve the model from catalog, dispatch it on engine, record it in the local-queue ring, and return the image bytes.
run_kind
Resolve a model of kind (an explicit id, else the catalog’s default for that kind), dispatch task, record the local job, and return the result. The generic core behind every non-image local endpoint (chat / tts / stt / video) so each stays a thin adapter.
stream_on_lane
Stream a chat on model_id’s lane as server-sent events through send (which answers false once the client has gone, ending the generation). Recorded like any local job. The caller has checked the model is loaded; if it unloads first, the stream carries the error.
tokenize_on_lane
Token ids for text from a loaded chat model, on its lane.