> ## Documentation Index
> Fetch the complete documentation index at: https://docs.definable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Definable and set up your environment.

## Requirements

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

## Quick Install

<Snippet file="install-definable.mdx" />

## Full Setup

<Steps>
  <Step title="Create a virtual environment">
    <Snippet file="setup-venv.mdx" />
  </Step>

  <Step title="Install Definable">
    <Snippet file="install-definable.mdx" />
  </Step>

  <Step title="Set your API key">
    <Snippet file="export-openai-key.mdx" />
  </Step>

  <Step title="Verify">
    ```python theme={null}
    from definable.agent import Agent

    agent = Agent(model="gpt-4o")
    output = agent.run("Hello!")
    print(output.content)
    ```
  </Step>
</Steps>

## Optional Dependencies

Install extras for specific features:

| Feature                         | Install command                        |
| ------------------------------- | -------------------------------------- |
| Discord interface               | `pip install 'definable[discord]'`     |
| All messaging interfaces        | `pip install 'definable[interfaces]'`  |
| File readers (PDF, DOCX, XLSX)  | `pip install 'definable[readers]'`     |
| HTTP server (FastAPI + Uvicorn) | `pip install 'definable[serve]'`       |
| Cron scheduling                 | `pip install 'definable[cron]'`        |
| JWT authentication              | `pip install 'definable[jwt]'`         |
| Memory with Mem0                | `pip install 'definable[mem0-memory]'` |
| Deep research                   | `pip install 'definable[research]'`    |
| CLI / TUI interface             | `pip install 'definable[cli]'`         |
| Full runtime (all of the above) | `pip install 'definable[runtime]'`     |

## Core Dependencies

These are installed automatically with `pip install definable`:

| Package            | Purpose                                                      |
| ------------------ | ------------------------------------------------------------ |
| `openai`           | OpenAI API client (also used by OpenAI-compatible providers) |
| `pydantic`         | Data validation and structured outputs                       |
| `httpx`            | Async HTTP client                                            |
| `tiktoken`         | Token counting                                               |
| `rich`             | Formatted logging and terminal output                        |
| `docstring-parser` | Tool description extraction from docstrings                  |
| `aiosqlite`        | SQLite async driver for memory and identity storage          |

## Environment Variables

Set API keys for the providers you use. Only the keys you need are required.

```bash theme={null}
# 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="..."
```

<Tip>
  You can also pass API keys directly when creating model instances:

  ```python theme={null}
  from definable.model.openai import OpenAIChat
  model = OpenAIChat(id="gpt-4o", api_key="sk-...")
  ```
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Your First Agent" icon="bolt" href="/first-agent">
    Build and run an agent with tools in 15 lines.
  </Card>

  <Card title="Models" icon="microchip" href="/models/overview">
    Explore all 10 supported LLM providers.
  </Card>
</CardGroup>
