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:
Install from Source¶
To install the latest development version:
Verify Installation¶
Check that Pygrad is installed correctly:
You should see the version number printed.
Install Ollama (Recommended)¶
Pygrad works best with a local LLM. We recommend Ollama:
Download from ollama.com
Then pull the required models:
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:
Ollama Connection Error¶
Make sure Ollama is running:
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.