Skip to main content

Requirements

  • Python 3.12 or higher
  • An API key from at least one LLM provider

Quick Install

pip install definable

Full Setup

1

Create a virtual environment

python3 -m venv .venv
source .venv/bin/activate
2

Install Definable

pip install definable
3

Set your API key

export OPENAI_API_KEY=sk-***
4

Verify

from definable.agent import Agent

agent = Agent(model="gpt-4o")
output = agent.run("Hello!")
print(output.content)

Optional Dependencies

Install extras for specific features:
FeatureInstall command
Discord interfacepip install 'definable[discord]'
All messaging interfacespip install 'definable[interfaces]'
File readers (PDF, DOCX, XLSX)pip install 'definable[readers]'
HTTP server (FastAPI + Uvicorn)pip install 'definable[serve]'
Cron schedulingpip install 'definable[cron]'
JWT authenticationpip install 'definable[jwt]'
Memory with Mem0pip install 'definable[mem0-memory]'
Deep researchpip install 'definable[research]'
CLI / TUI interfacepip install 'definable[cli]'
Full runtime (all of the above)pip install 'definable[runtime]'

Core Dependencies

These are installed automatically with pip install definable:
PackagePurpose
openaiOpenAI API client (also used by OpenAI-compatible providers)
pydanticData validation and structured outputs
httpxAsync HTTP client
tiktokenToken counting
richFormatted logging and terminal output
docstring-parserTool description extraction from docstrings
aiosqliteSQLite async driver for memory and identity storage

Environment Variables

Set API keys for the providers you use. Only the keys you need are required.
# LLM Providers
export OPENAI_API_KEY="sk-..."
export DEEPSEEK_API_KEY="sk-..."
export MOONSHOT_API_KEY="sk-..."
export XAI_API_KEY="xai-..."
export ANTHROPIC_API_KEY="sk-ant-..."

# Embedding Providers
export VOYAGE_API_KEY="pa-..."

# Reranking Providers
export COHERE_API_KEY="..."
You can also pass API keys directly when creating model instances:
from definable.model.openai import OpenAIChat
model = OpenAIChat(id="gpt-4o", api_key="sk-...")

Next Steps

Your First Agent

Build and run an agent with tools in 15 lines.

Models

Explore all 10 supported LLM providers.