Skip to main content

Architecture

All Architecture pages in the AgentOS documentation.

📄️LLM Providers

AgentOS abstracts every LLM behind a single IProvider interface. Thirteen providers are wired in directly OpenRouter and Requesty route to models from many vendors, and LiteLLM is a proxy you host. Every provider speaks the same streaming protocol, supports the same tool-call shape (with the documented exceptions below), and reports each call's token usage in the same shape; Prices and Cost Reporting says which providers also report the call's cost. The fallback chain is auto-built from whichever keys are set in the environment and is overridable per agent.

📄️CLI Error Codes

CLISubprocessError is the error a CLISubprocessBridge throws when the CLI it runs fails, and CLI_ERROR names nine codes for it. AgentOS ships two bridges, for the claude and gemini binaries behind the claude-code-cli and gemini-cli providers (CLI Providers). Those two bridges and their providers are the only AgentOS code that raises these errors: the CLI Registry reports a missing binary in its scan result and throws none of them. This page gives the class, each code, and when the built-in bridges and providers raise it.

📄️OAuth Auth

The @framers/agentos/auth subpath export provides OAuth primitives: a browser-based OAuth 2.0 authorization-code flow with PKCE for OpenAI (obtaining API access from a ChatGPT subscription, as the Codex CLI does), the same flow for Twitter, Instagram, LinkedIn and Facebook, and the token store, callback server and PKCE helpers they share. For a web server it provides the same grant split across two requests (RedirectOAuthFlow), secrets sealed at rest with AES-256-GCM (sealSecret, openSecret) and a token store that keeps each grant sealed (SealedTokenStore).