# Providers

| Aspect | Current design |
| --- | --- |
| Vendors | One adapter directory per vendor under `openprogram/models/providers/adapters/`, with a `provider.json` declaring models, wire API and login methods. Anthropic, OpenAI, Google Gemini, Amazon Bedrock, Azure OpenAI, xAI, DeepSeek, Mistral, Groq, OpenRouter, GitHub Copilot and others, plus local Ollama, LM Studio, vLLM and llama.cpp. |
| Request | The runtime hands over a ready `Context` (system, messages, tools). The adapter translates it to the wire request and applies that vendor's prompt caching. Nothing above knows vendor formats. |
| Keys | One ordered list of keys and sign-ins per provider. A conversation keeps one; a limited or refused one gives way to the next. |
| Failures | Every error maps to one taxonomy, is retried or failed over by class, bounded by timeouts, and reaches the UI as a structured error. |
| Catalog | From `provider.json`, subscription catalogs and models.dev. Thinking effort and the Fast tier are declared per provider. |
| Manage | `openprogram providers` (`login`, `list`, `use`, `status`, `doctor`, `accounts`), or Settings → Model services |

## Translation and caching

| Record | Covers |
| --- | --- |
| [Request build](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/requests/request-build.html) | Unified Context, per-provider translation, caching modes |
| [Cache control passthrough](https://fzkuji.github.io/OpenProgram/docs/reference/design/plans/cache-control-passthrough.html) | Per-block Anthropic `cache_control` |
| [Routing overview](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/routing-overview.html) | Which session and branch uses which model; failover switches |
| [Request redaction](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/requests/request-redaction.html) | Placeholders for secrets and email before sending, restored in the reply |
| [Web search](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/requests/web-search.html) | Provider search or local `web_search`; citations in the transcript |
| [Record and replay](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/requests/record-replay.html) | Redacted JSONL recordings replayed offline for deterministic tests |
| [Codex transport](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/requests/codex-transport.html) | Kept WebSocket sending only new input; zstd-compressed HTTP otherwise |
| [Provider quota](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/provider-quota.html) | Plan windows, balances and rate limits per provider; 30-day spend; failure causes |
| [Context composition](https://fzkuji.github.io/OpenProgram/docs/reference/design/context/composition.html) | Upstream: how content is layered and assembled (L0, L1, L2) |

## Credentials and accounts

| Record | Covers |
| --- | --- |
| [Companies, ways and credentials](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/credential-model.html) | One company's architecture: where a credential comes from, is stored and is read |
| [Credential validation](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/credential-validation-unification.html) | The validation entry point |
| [Credential status](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/credential-status-redesign.html) | Usable or stopped |
| [API key resolution](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/api-key-resolution-unification.html) | Where a key comes from |
| [Auth storage](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/unified-auth-storage.html) | Self-contained storage |
| [Provider keys and failover](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/auth/unified-account-management.html) | The list, the choice per conversation, what a failure does |

## Reliability

| Record | Covers |
| --- | --- |
| [Fault tolerance](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/reliability/llm-fault-tolerance.html) | Overall design and timeouts |
| [Request repair](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/reliability/request-repair.html) | Shape refusals (byte cap, refused prefill) mended and resent, the lesson kept |
| [Error retry](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/reliability/error-retry.html) | Handling and retry decisions |
| [Error taxonomy](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/reliability/error-taxonomy-propagation.html) | Structured errors all the way to the UI |
| [Error and timeout mechanism](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/reliability/error-and-timeout-mechanism.html) | Visual walk-through |

## Model catalog

| Record | Covers |
| --- | --- |
| [Models](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/models/overview.html) | Data layout, fetch, merge, provider configuration |
| [Thinking effort](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/models/thinking-effort.html) | Declarative per-provider mapping |
| [Fast tier](https://fzkuji.github.io/OpenProgram/docs/reference/design/providers/models/fast-tier.html) | Two-tier detection, storage, wires |
