Skip to content

Installation

This guide will help you install and set up DeepCritical on your system.

Prerequisites

  • Python 3.11 or higher
  • uv package manager (recommended) or pip
  • At least one LLM API key (OpenAI, Anthropic, or HuggingFace)

Installation Steps

uv is a fast Python package installer and resolver. Install it using the standalone installer (recommended):

Unix/macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Alternative methods:

# Using pipx (recommended if you have pipx installed)
pipx install uv

# Or using pip
pip install uv

After installation, restart your terminal or add ~/.cargo/bin to your PATH.

2. Clone the Repository

git clone https://github.com/DeepCritical/GradioDemo.git
cd GradioDemo

3. Install Dependencies

Using uv (recommended):

uv sync

Using pip:

pip install -e .

4. Install Optional Dependencies

For embeddings support (local sentence-transformers):

uv sync --extra embeddings

For Modal sandbox execution:

uv sync --extra modal

For Magentic orchestration:

uv sync --extra magentic

Install all extras:

uv sync --all-extras

5. Configure Environment Variables

Create a .env file in the project root:

# Required: At least one LLM provider
LLM_PROVIDER=openai  # or "anthropic" or "huggingface"
OPENAI_API_KEY=your_openai_api_key_here

# Optional: Other services
NCBI_API_KEY=your_ncbi_api_key_here  # For higher PubMed rate limits
MODAL_TOKEN_ID=your_modal_token_id
MODAL_TOKEN_SECRET=your_modal_token_secret

See the Configuration Guide for all available options.

6. Verify Installation

Run the application:

uv run gradio run src/app.py

Open your browser to http://localhost:7860 to verify the installation.

Development Setup

For development, install dev dependencies:

uv sync --all-extras --dev

Install pre-commit hooks:

uv run pre-commit install

Troubleshooting

Common Issues

Import Errors: - Ensure you've installed all required dependencies - Check that Python 3.11+ is being used

API Key Errors: - Verify your .env file is in the project root - Check that API keys are correctly formatted - Ensure at least one LLM provider is configured

Module Not Found: - Run uv sync or pip install -e . again - Check that you're in the correct virtual environment

Port Already in Use: - Change the port in src/app.py or use environment variable - Kill the process using port 7860

Next Steps