Skip to main content

Crate el_engine_candle

Crate el_engine_candle 

Source
Expand description

el-engine-candle — inference engine adapter over Candle (ADR-002), implementing el_runtime::InferenceEngine / RuntimeAcl.

Consumers supply their own model file; see CandleEngine::from_path and CandleEngine::from_bytes. For tests that need a working engine without a model asset, use CandleEngine::toy.

Expected GGUF tensor names:

  • token_embd.weight — embedding table [vocab, dim]
  • output.weight or lm_head.weight — lm-head [vocab, dim] (standard Llama layout)

Float logits are quantised to integer milli-logits at the ACL boundary, so Candle’s Tensor/Device types never cross into the domain.

Structs§

CandleEngine
Candle-backed inference engine.
LocalLlmProvider
Wraps a CandleEngine behind the LlmProvider trait using a byte-level tokenizer. A production build would swap in a HuggingFace tokenizer loaded from the model file.
QwenChatProvider
A real local chat backend: a Qwen2 GGUF model + its tokenizer, driven through el_runtime::InferenceSession.
QwenEngine
A real Qwen2 transformer InferenceEngine.
QwenExpert
A safety expert logit source for contrastive steering (ADR-013): a second Qwen engine — in production base + a safety LoRA; here any same-tokenizer Qwen GGUF — loaded through the ADR-006 provenance gate and primed with the turn’s prompt so its logits align with the base engine’s. The session feeds it the committed tokens via ExpertLogits::logits.