Skip to main content

Crate aonyx_llm

Crate aonyx_llm 

Source
Expand description

§aonyx-llm

Multi-provider LLM router. One LlmProvider trait, several implementations, one configurable fallback chain.

§Providers

  • anthropic — native Anthropic Messages API (streaming SSE).
  • openai_compat — shared OpenAI-compatible backend.
    • openai — public OpenAI API (https://api.openai.com).
    • openrouter — OpenRouter aggregator, with optional attribution headers.
    • lm_studio — local OpenAI-compatible LM Studio server.
  • ollama — local Ollama (/api/chat), JSON-lines streaming.
  • claude_code — wraps the installed claude binary; no API key required (auth delegated to Claude Code subscription / its env vars).
  • nous_portal — Nous Portal endpoint (deferred).

§Router

Router holds an ordered list of providers and forwards each request to the first one whose stream opens successfully.

Re-exports§

pub use claude_code::ClaudeCodeProvider;
pub use claude_code::CLAUDE_DEFAULT_BIN;
pub use ollama::OllamaProvider;
pub use ollama::OLLAMA_DEFAULT_BASE_URL;
pub use openai_compat::OpenAiCompatProvider;
pub use router::Router;

Modules§

anthropic
Anthropic Claude provider — streaming over the Messages API.
claude_code
Claude Code provider — uses an installed claude binary as the backend.
lm_studio
LM Studio provider — OpenAI-compatible with a user-configurable base URL.
nous_portal
Nous Portal provider.
ollama
Ollama provider — JSON-lines streaming from POST /api/chat.
openai
OpenAI Chat Completions provider.
openai_compat
OpenAI Chat Completions compatible providers.
openrouter
OpenRouter provider.
retry
Shared HTTP retry/backoff for LLM providers (Phase RR).
router
Fallback chain router.