Installation

LRS-Agents can be installed via pip or from source.

Requirements

  • Python 3.9+

  • pip or conda

Basic Installation

Install the latest stable version from PyPI:

pip install lrs-agents

This installs the core package with minimal dependencies.

Installation with Optional Dependencies

LRS-Agents has several optional dependency groups for different use cases:

All Features

Install everything:

pip install lrs-agents[all]

LangChain Integration

For LangChain tools and agents:

pip install lrs-agents[langchain]

This includes:

  • langchain

  • langchain-anthropic

  • langchain-openai

  • langchain-community

OpenAI Integration

For OpenAI Assistants:

pip install lrs-agents[openai]

Monitoring & Visualization

For dashboards and visualizations:

pip install lrs-agents[monitoring]

This includes:

  • streamlit

  • plotly

  • matplotlib

Development

For contributing to LRS-Agents:

pip install lrs-agents[dev]

This includes linting, formatting, and testing tools.

Installation from Source

For the latest development version:

git clone https://github.com/NeuralBlitz/lrs-agents.git
cd lrs-agents
pip install -e .

Development Installation

To contribute to LRS-Agents:

git clone https://github.com/NeuralBlitz/lrs-agents.git
cd lrs-agents
pip install -e ".[dev,test]"

Verify Installation

Check that LRS-Agents is installed correctly:

import lrs
print(lrs.__version__)
# Output: 0.2.0

Quick Test

Run a simple test:

from lrs.core.precision import PrecisionParameters

precision = PrecisionParameters()
print(f"Initial precision: {precision.value}")

precision.update(0.1)  # Low error
print(f"After success: {precision.value}")

Configuration

API Keys

LRS-Agents requires API keys for LLM providers. Set them as environment variables:

# Anthropic (Claude)
export ANTHROPIC_API_KEY="sk-ant-api03-..."

# OpenAI (GPT-4)
export OPENAI_API_KEY="sk-..."

Or in Python:

import os
os.environ["ANTHROPIC_API_KEY"] = "sk-ant-api03-..."

Environment Variables

Optional configuration:

# Logging
export LRS_LOG_LEVEL="INFO"
export LRS_LOG_DIR="./logs"

# Database (optional)
export DATABASE_URL="postgresql://user:pass@localhost/lrs"

# Performance
export LRS_MAX_WORKERS="4"
export LRS_CACHE_ENABLED="true"

Docker Installation

Run LRS-Agents in Docker:

docker pull lrsagents/lrs-agents:latest
docker run -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY lrsagents/lrs-agents

Or with Docker Compose:

cd docker
docker-compose up -d

This starts:

  • LRS-Agents API server (port 8000)

  • Streamlit dashboard (port 8501)

  • PostgreSQL database (port 5432)

Kubernetes Deployment

Deploy to Kubernetes:

kubectl create namespace lrs-agents
kubectl apply -f k8s/

See the Production Deployment guide for details.

Troubleshooting

Import Errors

If you get import errors:

# Ensure package is installed
pip list | grep lrs-agents

# Reinstall if needed
pip install --force-reinstall lrs-agents

Missing Dependencies

If specific features don’t work:

# Install all optional dependencies
pip install lrs-agents[all]

Version Conflicts

If you have dependency conflicts:

# Create fresh virtual environment
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows
pip install lrs-agents[all]

GPU Support

For GPU-accelerated inference (optional):

# Install PyTorch with CUDA
pip install torch --index-url https://download.pytorch.org/whl/cu118

# Then install LRS-Agents
pip install lrs-agents

Getting Help

If you encounter issues:

Next Steps