brazen 0.0.1

A stateless, swiss-army-knife adapter for every LLM provider and protocol.
Documentation
# Embedded provider table (arch §4.2). Parsed through the SAME
# `toml::from_str::<PartialConfig>` path as a user config file — the lowest-
# precedence operand of the resolution fold, never a bootstrap special case
# (config §3.5). A unit test parses this file so a malformed edit fails the
# build, not a user run.

# Transport timeouts in whole seconds (config §4). The single home for these
# numbers — `bz` reads them off the resolved config and stamps the request, so the
# bin holds no magic constants. `timeout_idle` is the INTER-CHUNK bound on the
# streaming body (reset per chunk): it abandons a provider that stalls mid-stream
# without capping total stream length, so a long-but-live generation is never cut.
# Override any of them in your config file / env / flags; delete one to unbound it.
timeout_connect = 30
timeout_response = 120
timeout_idle = 300

[[provider]]
name = "anthropic"
base_url = "https://api.anthropic.com"
protocol = "anthropic_messages"
auth = "api_key"
api_header = { name = "x-api-key", scheme = "raw" }
beta_headers = [["anthropic-version", "2023-06-01"]]
body_defaults = { max_tokens = 4096 }   # Anthropic requires max_tokens; the row's sane default, overridable via config/flag (config §4.1)
model_prefixes = ["claude-"]            # owns the claude- family, so `bz -m claude-… "q"` routes here with no --provider (arch §4.3)
ambient = { format = "api_key_env", path = "ANTHROPIC_API_KEY" }   # vendor-conventional key alias as a ROW-SCOPED, store-miss source — below BRAZEN_API_KEY/--api-key, can't leak cross-vendor or shadow a stored cred (auth §5.5)

[[provider]]
name = "openai"
base_url = "https://api.openai.com/v1"
protocol = "openai_chat"
auth = "bearer"
api_header = { name = "Authorization", scheme = "bearer" }
model_prefixes = ["gpt-", "chatgpt-", "o1", "o3", "o4"]   # the OpenAI families; openai-responses (same models, other protocol) ships none, so it stays explicit (arch §4.3)

# Mistral speaks the OpenAI chat dialect verbatim — the severability proof: one
# row, ZERO Rust (providers §2). Reuses the OpenAiChat protocol + bearer auth.
[[provider]]
name = "mistral"
base_url = "https://api.mistral.ai/v1"
protocol = "openai_chat"
auth = "bearer"
api_header = { name = "Authorization", scheme = "bearer" }
model_prefixes = ["mistral-", "ministral-", "magistral-", "codestral-", "pixtral-"]

[[provider]]
name = "openai-responses"
base_url = "https://api.openai.com/v1"
protocol = "openai_responses"
auth = "bearer"
api_header = { name = "Authorization", scheme = "bearer" }
# No model_prefixes: openai-responses serves the SAME OpenAI model ids as `openai`
# over a different protocol. Claiming them would make every gpt-… ambiguous (78),
# so this alternate-protocol row stays opt-in via explicit --provider (arch §4.3).

# Google authenticates with a custom header NAME carrying the raw key — pure row
# DATA read by the shared ApiKeyAuth, no new Auth impl (providers §4.1).
[[provider]]
name = "google"
base_url = "https://generativelanguage.googleapis.com"
protocol = "google_generative_ai"
auth = "api_key"
api_header = { name = "x-goog-api-key", scheme = "raw" }
model_prefixes = ["gemini-"]

# Local Ollama needs no auth: `auth = "none"` reads no credential and writes no
# header, so a keyless row carries no `api_header` (providers §5.1).
[[provider]]
name = "ollama"
base_url = "http://localhost:11434"
protocol = "ollama_chat"
auth = "none"