Installation¶
This guide covers all installation methods for LLM Answer Watcher.
System Requirements¶
Python Version¶
LLM Answer Watcher requires Python 3.12 or 3.13. It uses modern Python features including:
- Native union type syntax (
|instead ofUnion) - Improved type hints
- Performance optimizations
Check your Python version:
Installing Python 3.12+¶
Download Python 3.12 from python.org
During installation:
- ✅ Check "Add Python to PATH"
- ✅ Check "Install pip"
Verify installation:
Installation Methods¶
Method 1: uv (Recommended)¶
uv is a fast, modern Python package installer written in Rust. It's significantly faster than pip and handles virtual environments automatically.
Install uv¶
Install LLM Answer Watcher¶
# Clone the repository
git clone https://github.com/nibzard/llm-answer-watcher.git
cd llm-answer-watcher
# Install all dependencies (creates .venv automatically)
uv sync
# For development with extra dependencies
uv sync --dev
Activate Virtual Environment¶
uv creates a .venv directory automatically. You can optionally activate it:
uv handles activation automatically
When you run uv run llm-answer-watcher, uv automatically uses the virtual environment.
Explicit activation is optional.
Method 2: pip¶
Traditional pip installation with manual virtual environment management.
# Clone the repository
git clone https://github.com/nibzard/llm-answer-watcher.git
cd llm-answer-watcher
# Create virtual environment
python3.12 -m venv .venv
# Activate virtual environment
source .venv/bin/activate # macOS/Linux
# or
.venv\Scripts\activate # Windows
# Install package in editable mode
pip install -e .
# For development with extra dependencies
pip install -e ".[dev]"
Method 3: PyPI (Coming Soon)¶
Once published to PyPI, you'll be able to install directly:
Verify Installation¶
Check that the installation was successful:
You should see output like:
Test the CLI help:
API Keys Setup¶
LLM Answer Watcher requires API keys from LLM providers. You need at least one provider configured.
Supported Providers¶
| Provider | Environment Variable | Get API Key |
|---|---|---|
| OpenAI | OPENAI_API_KEY |
platform.openai.com |
| Anthropic | ANTHROPIC_API_KEY |
console.anthropic.com |
| Mistral | MISTRAL_API_KEY |
console.mistral.ai |
| X.AI (Grok) | XAI_API_KEY |
x.ai/api |
| Google (Gemini) | GOOGLE_API_KEY |
aistudio.google.com |
| Perplexity | PERPLEXITY_API_KEY |
www.perplexity.ai/settings/api |
Setting API Keys¶
Temporary (Current Session)¶
Persistent (.env file)¶
Create a .env file in your project directory:
# .env file
OPENAI_API_KEY=sk-your-openai-key
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key
MISTRAL_API_KEY=mistral-your-key
XAI_API_KEY=xai-your-grok-key
GOOGLE_API_KEY=AIza-your-google-key
PERPLEXITY_API_KEY=pplx-your-perplexity-key
Load the file before running:
Using direnv (Recommended for Development)¶
direnv automatically loads .env when you enter the directory:
# Install direnv
brew install direnv # macOS
# or
sudo apt install direnv # Ubuntu/Debian
# Create .envrc file
echo 'source .env' > .envrc
# Allow direnv to load it
direnv allow
Now your keys load automatically when you cd into the directory.
Development Dependencies¶
If you're contributing or want to run tests:
This installs additional tools:
- pytest - Test runner
- pytest-httpx - HTTP mocking for tests
- pytest-cov - Coverage reporting
- pytest-mock - Advanced mocking
- freezegun - Time mocking
- ruff - Fast Python linter and formatter
- mkdocs - Documentation builder
- mkdocs-material - Material theme for MkDocs
Docker Installation (Optional)¶
For containerized deployment:
# Dockerfile
FROM python:3.12-slim
WORKDIR /app
# Install uv
RUN pip install uv
# Copy project files
COPY . .
# Install dependencies
RUN uv sync
# Set entrypoint
ENTRYPOINT ["uv", "run", "llm-answer-watcher"]
Build and run:
docker build -t llm-answer-watcher .
docker run -e OPENAI_API_KEY=$OPENAI_API_KEY \
-v $(pwd)/output:/app/output \
llm-answer-watcher run --config config.yaml
Troubleshooting¶
Python Version Issues¶
If you have multiple Python versions:
# Use specific Python version
python3.12 -m venv .venv
source .venv/bin/activate
python --version # Verify it's 3.12.x
Permission Errors¶
If you get permission errors during installation:
# Don't use sudo with pip in virtual environments
# Instead, ensure your virtual environment is activated
source .venv/bin/activate
pip install -e .
SSL Certificate Errors¶
On macOS, you might need to install certificates:
Module Not Found Errors¶
If you get ModuleNotFoundError after installation:
# Ensure you're in the virtual environment
which python # Should point to .venv/bin/python
# Re-install the package
pip install -e .
uv Installation Issues¶
If uv sync fails:
Next Steps¶
Now that LLM Answer Watcher is installed:
Uninstallation¶
To remove LLM Answer Watcher: