Skip to main content

Requirements

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

Install

pip install definable

Core Dependencies

Definable installs these automatically:
PackagePurpose
openaiOpenAI API client (also used by OpenAI-compatible providers)
pydanticData validation and structured outputs
httpxHTTP client for async requests
tiktokenToken counting
richFormatted logging and output
docstring-parserTool description extraction
aiosqliteSQLite async driver for memory and identity resolution

Optional Dependencies

Some features require additional packages:
FeaturePackage(s)Install
PDF reading (knowledge)pypdfpip install pypdf
URL readingbeautifulsoup4pip install beautifulsoup4
Voyage AI embeddingsvoyageaipip install voyageai
Cohere rerankingcoherepip install cohere
PgVector databasepsycopg[binary], pgvectorpip install psycopg[binary] pgvector
Discord interfacediscord.py>=2.3.0pip install 'definable[discord]'
All interfacesdiscord.py>=2.3.0pip install 'definable[interfaces]'
File readers (PDF, DOCX, PPTX, XLSX, ODS, RTF)pypdf, python-docx, python-pptx, openpyxl, odfpy, striprtfpip install 'definable[readers]'
PostgreSQL memoryasyncpg>=0.29.0pip install 'definable[postgres-memory]'
Redis memoryredis>=5.0.0pip install 'definable[redis-memory]'
Qdrant memoryqdrant-client>=1.9.0pip install 'definable[qdrant-memory]'
Chroma memorychromadb>=0.5.0pip install 'definable[chroma-memory]'
MongoDB memorymotor>=3.3.0pip install 'definable[mongodb-memory]'
Pinecone memorypinecone>=5.0.0pip install 'definable[pinecone-memory]'
Mistral OCRmistralai>=1.0.0pip install 'definable[mistral-ocr]'
HTTP serverfastapi, uvicornpip install 'definable[serve]'
Cron schedulingcroniterpip install 'definable[cron]'
JWT authenticationpyjwtpip install 'definable[jwt]'
Dev mode (hot-reload)watchfilespip install watchfiles
Full runtimeAll of the abovepip install 'definable[runtime]'
The Signal interface has no pip dependency — it uses an external signal-cli-rest-api Docker container. See the Signal interface docs for setup instructions.

Environment Variables

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

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

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

Verify Installation

import definable
from definable.models import OpenAIChat

model = OpenAIChat(id="gpt-4o")
response = model.invoke(messages=[{"role": "user", "content": "Hello!"}])
print(response.content)
If you see a response, you are ready to go.

Next Steps