pub enum LlmBackend {
Mock,
Ollama {
base_url: String,
model: String,
},
OpenAiCompatible {
base_url: String,
api_key: String,
model: String,
},
Anthropic {
base_url: String,
api_key: String,
model: String,
},
Google {
base_url: String,
api_key: String,
model: String,
},
Command {
command: String,
timeout_secs: u64,
},
}Expand description
Which LLM backend the server uses for fact extraction.
Variants§
Mock
Deterministic mock that always returns {"facts": []}.
Use only for tests — memory_add will produce zero facts.
Ollama
Ollama-backed chat-completion client (local, free) — uses Ollama’s
native /api/chat.
OpenAiCompatible
Any OpenAI chat-completions-compatible endpoint — OpenAI itself,
Azure OpenAI, Groq, Together, Mistral, DeepSeek, Perplexity, OpenRouter,
Fireworks, vLLM, LM Studio, LocalAI, or Ollama’s /v1 compat layer.
Switch providers by changing base_url alone.
Anthropic
Anthropic Claude via the Messages API.
Google Gemini via the generateContent API.
Command
Shell-out extensibility escape hatch. Runs a user-supplied command
per extraction call, writes a JSON request to stdin, reads JSON from
stdout. See engram::llm_command for the stdin/stdout contract.
Implementations§
Trait Implementations§
Source§impl Clone for LlmBackend
impl Clone for LlmBackend
Source§fn clone(&self) -> LlmBackend
fn clone(&self) -> LlmBackend
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LlmBackend
impl RefUnwindSafe for LlmBackend
impl Send for LlmBackend
impl Sync for LlmBackend
impl Unpin for LlmBackend
impl UnsafeUnpin for LlmBackend
impl UnwindSafe for LlmBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more