Skip to main content

pick_default_client

Function pick_default_client 

Source
pub async fn pick_default_client() -> Result<Box<dyn LlmClient>, LlmError>
Expand description

Select an LLM client at runtime, reading the environment:

  1. Probe Ollama at OLLAMA_BASE_URL (default http://localhost:11434) via GET /api/version. If reachable in 500ms, use it.
  2. Otherwise, if ANTHROPIC_API_KEY is set, use AnthropicHaikuClient.
  3. Otherwise, return LlmError::NoLlmAvailable.