Installation

opentine requires Python 3.11 or higher. It works on Linux, macOS, and Windows.

Basic Install

Install the core package with pip. This gives you the Agent,Run, Step classes, all built-in tools, and thetine CLI — but no model adapters.

Terminal
pip install opentine

Model Provider Extras

Each model provider is an optional extra. Install only what you need, or use[all] to get everything.

Terminal
# Install with a specific model provider
pip install "opentine[anthropic]"
pip install "opentine[openai]"
pip install "opentine[google]"
pip install "opentine[ollama]"

# Install with all providers
pip install "opentine[all]"

The available extras are:

  • [anthropic] — Anthropic Claude models via the Anthropic adapter from opentine.models.anthropic
  • [openai] — OpenAI GPT models via the OpenAI adapter from opentine.models.openai
  • [google] — Google Gemini models via the Google adapter from opentine.models.google
  • [ollama] — Local models via the Ollama adapter from opentine.models.ollama
  • [all] — All of the above

Using uv (Recommended)

uvis a fast Python package manager that handles virtual environments automatically. It's the recommended way to manage opentine projects.

Terminal
# Install uv (if you don't have it)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create a new project and add opentine
uv init my-agent
cd my-agent
uv add "opentine[anthropic]"

Environment Variables

Each model provider reads its API key from an environment variable. You only need to set the variables for the providers you plan to use.

ProviderEnvironment Variable
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
GoogleGOOGLE_API_KEY
OllamaOLLAMA_HOST (defaults to http://localhost:11434)

Setting Up .env

Create a .env.example file in your project root as a template, then copy it to .env and fill in your keys. Make sure.env is in your .gitignore.

.env.example
# .env.example — copy to .env and fill in your keys

# Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-...

# OpenAI (GPT)
OPENAI_API_KEY=sk-...

# Google (Gemini)
GOOGLE_API_KEY=AIza...

# Ollama (local models)
OLLAMA_HOST=http://localhost:11434
Terminal
# Copy the example and add your keys
cp .env.example .env

# Or export directly in your shell
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."

Verify the Installation

Check that opentine is installed correctly:

Terminal
python -c "import opentine; print(opentine.__version__)"

To verify your model provider is configured correctly, run a quick test:

verify.py
from opentine import Agent
from opentine.models.anthropic import Anthropic

agent = Agent(model=Anthropic("claude-sonnet-4-20250514"))
run = agent.run_sync("Say hello")
print("Success!" if run.total_cost > 0 else "Something went wrong")

Multiple Providers

You can install multiple providers at once. This is useful if you want to compare models or switch between them.

Terminal
# Install multiple providers at once
pip install "opentine[anthropic,openai]"

# Or just install everything
pip install "opentine[all]"

Next Steps

  • Follow the Quickstart to build your first agent
  • Learn about the available Models and their configuration options
  • Explore the built-in Tools for web, filesystem, shell, and Python