Skip to main content

Module engine

Module engine 

Source
Expand description

Pluggable inference engines, generalised to all task kinds.

The synthetic engine produces real, decodable bytes for every kind and is the default — it’s what unattended CI exercises end-to-end.

Real high-performance engines (llama.cpp, whisper.cpp, candle SD, Piper, ffmpeg) live behind cargo features so the default build stays small and the CI matrix stays fast. See the feature notes per implementation block below.

Modules§

download
Shared model-file provisioning used by every real engine.
multi
Composite engine that delegates per (kind, model).
sdcpp
Engine that runs real image inference by subprocess-invoking the stable-diffusion.cpp (sd-cli) binary.

Structs§

EngineCapabilities
What a single engine is able to do.
SyntheticEngine

Constants§

MODEL_WILDCARD
Sentinel string the studio’s claim filter recognises as “any model is fine”. Real engines that can actually serve any model (e.g. a GGUF-aware image engine that downloads on demand) advertise it. The synthetic engine deliberately does NOT — it would happily fulfil real-model jobs with placeholder bytes, which is destructive on a live queue.

Traits§

Engine

Functions§

build
Build the engine for this worker.
default_models_root
Legacy hook retained for any external caller; mirrors Config::default().models_root.
render_animated_webp
Synthetic “video”: an animated WebP made of frames frames. We always emit WebP (decoders are everywhere); real video generation would use the video-ffmpeg feature.
render_procedural
Deterministic 512×512 image whose colours depend on hash(prompt).
render_wav
Real WAV file (16-bit PCM, mono, 22 050 Hz) — sine wave whose frequency depends on hash(text). Duration is 1.0 s.
synthetic_llm_response
Synthetic LLM response — deterministic by prompt hash, mimics the OpenAI chat-completion response shape so consumers can parse it.
synthetic_stt_response
Synthetic STT response — Whisper-style JSON.