Installation
Requirements
- Python 3.11+
- An API key for your chosen LLM provider
Core install
pip install agentix
The core package bundles all supported LLM provider SDKs along with pydantic, httpx, tiktoken, and MCP support. No extra install step is needed to use any provider.
Optional extras
| Extra | Installs | Use case |
|---|---|---|
redis | redis | RedisStorageBackend, RedisCircuitBreakerBackend for distributed deployments |
gateway | aiohttp + adapter deps | Messaging gateway — HTTP webhooks, Slack, WhatsApp, Email |
gateway-slack | slack-sdk | Slack adapter only (lighter than full gateway) |
gateway-whatsapp | gateway-core | WhatsApp Business API adapter |
gateway-email | aiosmtplib | Email adapter (SMTP/IMAP) |
dev | pytest, mypy, ruff, fakeredis | Development and testing tools |
all | redis + all gateway adapters + dev | Everything |
pip install agentix[redis] # Redis session storage & circuit breaker
pip install agentix[gateway] # All messaging gateway adapters
pip install agentix[all] # Everything
API key
Pass your LLM provider API key via the AGENTIX_API_KEY environment variable:
export AGENTIX_API_KEY=your-api-key-here
Or supply it inline via llm_options:
options = AgentixAgentOptions(
provider="anthropic",
llm_options={"api_key": "your-api-key-here"},
)
Agentix automatically redacts
api_keyfrom logs and__repr__to prevent accidental leakage.
OpenAI-compatible endpoints
For any OpenAI-compatible endpoint (Cerebras, Ollama, vLLM, LiteLLM, etc.) use provider="openai_compatible" and set base_url:
options = AgentixAgentOptions(
provider="openai_compatible",
model="your-model-name",
llm_options={
"base_url": "http://localhost:11434/v1", # e.g. Ollama
"api_key": "ollama",
},
)
Or via environment variables:
export AGENTIX_PROVIDER=openai_compatible
export AGENTIX_BASE_URL=http://localhost:11434/v1
export AGENTIX_MODEL=llama3.2
Web search keys (optional)
WebSearch auto-detects which backend to use based on available keys:
export TAVILY_API_KEY=tvly-... # recommended
export BRAVE_API_KEY=BSA...
export SERPAPI_API_KEY=...
# (no key) → falls back to DuckDuckGo
Verify installation
import agentix
print(agentix.__version__)