Install
Install coco-framework with the extras your agent needs, see every package and its import, and set your model provider's keys.
Install coco-framework with the extras your agent needs.
Prerequisites: Python 3.10 or later, below 4.0.
Install the framework
coco-framework holds every runtime library: the core, the graph engine, the checkpointers, and both model providers.
pip install "coco-framework[all]" # or: uv pip install "coco-framework[all]"Add only the extras your agent uses:
| Extra | Install command | Adds |
|---|---|---|
openai | pip install "coco-framework[openai]" | OpenAI and OpenAI-compatible chat models and embeddings (openai, tiktoken) |
anthropic | pip install "coco-framework[anthropic]" | Anthropic Claude chat models (anthropic) |
sqlite | pip install "coco-framework[sqlite]" | The SQLite checkpointers (aiosqlite, sqlite-vec) |
postgres | pip install "coco-framework[postgres]" | The PostgreSQL checkpointers (psycopg, psycopg-pool, ormsgpack) |
mcp | pip install "coco-framework[mcp]" | Model Context Protocol integration (fastmcp) |
azure-identity | pip install "coco-framework[azure-identity]" | Azure Active Directory authentication (azure-identity) |
all | pip install "coco-framework[all]" | Every extra above |
Good to know: PostgresSaver uses psycopg, which needs the libpq client library. If import psycopg fails, install psycopg[binary], which bundles it.
Packages
coco-framework is also built as nine separate trustcoco-* distributions, for environments that need only part of the runtime. They're served from Coco's package index, not PyPI.
| Distribution | Version | Import | Holds |
|---|---|---|---|
trustcoco | 1.4.2 | coco | create_agent, init_chat_model, AgentMiddleware, the built-in middleware, and structured output |
trustcoco-core | 1.6.5 | coco_core | Messages, @tool, runnables, prompt templates, and CocoTracer |
trustcoco-graph | 1.2.12 | coco_graph | StateGraph, the execution engine, interrupt(), Command, Send, and streaming |
trustcoco-graph-prebuilt | 1.1.0 | coco_graph.prebuilt | ToolNode, ValidationNode, tools_condition, InjectedState, InjectedStore, ToolRuntime |
trustcoco-graph-checkpoint | 4.2.0 | coco_graph.checkpoint | BaseCheckpointSaver, InMemorySaver, and the serializers |
trustcoco-graph-checkpoint-sqlite | 3.1.1 | coco_graph.checkpoint.sqlite | SqliteSaver and AsyncSqliteSaver |
trustcoco-graph-checkpoint-postgres | 3.1.2 | coco_graph.checkpoint.postgres | PostgresSaver and AsyncPostgresSaver |
trustcoco-openai | 1.6.6 | coco_openai | ChatOpenAI, AzureChatOpenAI, OpenAIEmbeddings, AzureOpenAIEmbeddings |
trustcoco-anthropic | 1.7.4 | coco_anthropic | ChatAnthropic, AnthropicLLM, convert_to_anthropic_tool |
Keep in mind: Install either coco-framework or the trustcoco-* distributions, not both. They hold the same modules.
Set model keys
| Variable | Read by | Used for |
|---|---|---|
OPENAI_API_KEY | coco_openai | The OpenAI API key. |
OPENAI_BASE_URL | coco_openai | An OpenAI-compatible endpoint, such as vLLM, Ollama, LiteLLM, or an internal gateway. |
ANTHROPIC_API_KEY | coco_anthropic | The Anthropic API key. |
See Model providers for Azure OpenAI and the other settings.