Skip to content

Installation

This guide covers how to install Pygrad on your system.

Requirements

  • Python: 3.10 or higher
  • Git: Required for cloning repositories
  • LLM Provider: Ollama (recommended) or OpenAI API key

Install from PyPI

The simplest way to install Pygrad is using pip:

pip install git+https://github.com/AaLexUser/pygrad.git

Install from Source

To install the latest development version:

git clone https://github.com/AaLexUser/pygrad
cd pygrad
pip install -e ".[dev]"

Verify Installation

Check that Pygrad is installed correctly:

python -c "import pygrad; print(pygrad.__version__)"

You should see the version number printed.

Pygrad works best with a local LLM. We recommend Ollama:

brew install ollama
ollama serve
curl -fsSL https://ollama.com/install.sh | sh
ollama serve

Download from ollama.com

Then pull the required models:

# LLM model
ollama pull qwen3-coder:30b

# Embedding model
ollama pull embeddinggemma:latest

Environment Setup

Create a .env file in your project directory:

# LLM Configuration
LLM_PROVIDER="ollama"
LLM_MODEL="qwen3-coder:30b"
LLM_API_KEY="ollama"
LLM_ENDPOINT="http://localhost:11434/v1"

# Embedding Configuration
EMBEDDING_PROVIDER="ollama"
EMBEDDING_MODEL="embeddinggemma:latest"
EMBEDDING_ENDPOINT="http://localhost:11434/api/embed"
EMBEDDING_DIMENSIONS="768"

# Optional
TELEMETRY_DISABLED=true

Troubleshooting

Import Error

If you get an import error, make sure you have all dependencies installed:

pip install cognee tree-sitter tree-sitter-python

Ollama Connection Error

Make sure Ollama is running:

ollama serve

Permission Error on Clone

If you can't clone private repositories, set up SSH keys or use HTTPS with authentication.

Next Steps

Now that you have Pygrad installed, continue to the Quick Start guide.