aonyx_llm/lib.rs
1//! # aonyx-llm
2//!
3//! Multi-provider LLM router. One [`LlmProvider`](aonyx_core::LlmProvider) trait,
4//! several implementations, one configurable fallback chain.
5//!
6//! ## Providers
7//! - [`anthropic`] — native Anthropic Messages API (streaming SSE).
8//! - [`openai_compat`] — shared OpenAI-compatible backend.
9//! - [`openai`] — public OpenAI API (`https://api.openai.com`).
10//! - [`openrouter`] — OpenRouter aggregator, with optional attribution headers.
11//! - [`lm_studio`] — local OpenAI-compatible LM Studio server.
12//! - [`ollama`] — local Ollama (`/api/chat`), JSON-lines streaming.
13//! - [`claude_code`] — wraps the installed `claude` binary; **no API key**
14//! required (auth delegated to Claude Code subscription / its env vars).
15//! - [`nous_portal`] — Nous Portal endpoint (deferred).
16//!
17//! ## Router
18//! [`Router`] holds an ordered list of providers and forwards each request to
19//! the first one whose stream opens successfully.
20
21#![forbid(unsafe_code)]
22#![warn(missing_docs, rust_2018_idioms)]
23
24pub mod anthropic;
25pub mod claude_code;
26pub mod lm_studio;
27pub mod nous_portal;
28pub mod ollama;
29pub mod openai;
30pub mod openai_compat;
31pub mod openrouter;
32pub mod retry;
33pub mod router;
34
35pub use claude_code::{ClaudeCodeProvider, CLAUDE_DEFAULT_BIN};
36pub use ollama::{OllamaProvider, OLLAMA_DEFAULT_BASE_URL};
37pub use openai_compat::OpenAiCompatProvider;
38pub use router::Router;