Step-by-step instructions for setting up BaseAgent
Before installing BaseAgent, ensure you have:
| Requirement | Version | Notes |
|---|---|---|
| Python | 3.9+ | Python 3.11+ recommended |
| pip | Latest | Python package manager |
| Git | 2.x | For cloning the repository |
| Tool | Purpose |
|---|---|
ripgrep (rg) |
Fast file searching (used by grep_files tool) |
tree |
Directory visualization |
# Clone the repository
git clone https://github.com/your-org/baseagent.git
cd baseagent
# Install with pip
pip install .This installs BaseAgent as a package with all dependencies.
# Clone the repository
git clone https://github.com/your-org/baseagent.git
cd baseagent
# Install dependencies
pip install -r requirements.txtFor development with editable installs:
git clone https://github.com/your-org/baseagent.git
cd baseagent
# Editable install
pip install -e .BaseAgent requires these Python packages:
litellm>=1.0.0 # LLM API abstraction
httpx>=0.24.0 # HTTP client
pydantic>=2.0.0 # Data validation
These are automatically installed via pip.
BaseAgent supports multiple LLM providers. Choose one:
# Set your Chutes API token
export CHUTES_API_TOKEN="your-token-from-chutes.ai"
# Configure provider
export LLM_PROVIDER="chutes"
export LLM_MODEL="moonshotai/Kimi-K2.5-TEE"Get your token at chutes.ai
# Set your OpenRouter API key
export OPENROUTER_API_KEY="sk-or-v1-..."
# Model is auto-configured for OpenRouterGet your key at openrouter.ai
# For Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
# For OpenAI
export OPENAI_API_KEY="sk-..."Create .env in the project root:
# .env file
CHUTES_API_TOKEN=your-token-here
LLM_PROVIDER=chutes
LLM_MODEL=moonshotai/Kimi-K2.5-TEE
LLM_COST_LIMIT=10.0python3 --version
# Expected: Python 3.11.x or higherpython3 -c "import litellm; print('litellm:', litellm.__version__)"
python3 -c "import httpx; print('httpx:', httpx.__version__)"
python3 -c "import pydantic; print('pydantic:', pydantic.__version__)"python3 -c "from src.core.loop import run_agent_loop; print('BaseAgent: OK')"python3 agent.py --instruction "Print 'Hello, BaseAgent!'"Expected output: JSONL events showing the agent executing your instruction.
baseagent/
├── agent.py # ✓ Entry point
├── src/
│ ├── core/
│ │ ├── loop.py # ✓ Agent loop
│ │ └── compaction.py # ✓ Context manager
│ ├── llm/
│ │ └── client.py # ✓ LLM client
│ ├── config/
│ │ └── defaults.py # ✓ Configuration
│ ├── tools/ # ✓ Tool implementations
│ ├── prompts/
│ │ └── system.py # ✓ System prompt
│ └── output/
│ └── jsonl.py # ✓ Event emission
├── requirements.txt # ✓ Dependencies
├── pyproject.toml # ✓ Package config
├── docs/ # ✓ Documentation
├── rules/ # Development guidelines
└── astuces/ # Implementation techniques
Solution: Install dependencies
pip install -r requirements.txt
# or
pip install litellm httpx pydanticSolution: Ensure you're in the project root directory
cd /path/to/baseagent
python3 agent.py --instruction "..."Solution: Verify your environment variables are set
# Check if variables are set
echo $CHUTES_API_TOKEN
echo $OPENROUTER_API_KEY
# Re-export if needed
export CHUTES_API_TOKEN="your-token"The grep_files tool will fall back to grep if rg is not available, but ripgrep is much faster.
Solution: Install ripgrep
# Ubuntu/Debian
apt-get install ripgrep
# macOS
brew install ripgrep
# Or via cargo
cargo install ripgrep- Quick Start - Run your first task
- Configuration - Customize settings
- Chutes Integration - Set up Chutes API