Installation and Usage Guide#
This page explains how to install Serapeum and its dependencies, using the recommended uv package manager, or plain pip. It also provides troubleshooting tips and common commands for development.
Project Information#
- Package name: serapeum
- Current version: 0.1.0
- Supported Python versions: 3.11–3.12 (requires Python >=3.11,<4.0)
Dependencies#
- Core runtime: ollama >= 0.5.4, numpy, filetype >= 1.2.0, requests >= 2.32.5
- Development group: pytest, pytest-cov, pre-commit, pre-commit-hooks, pytest-asyncio, nest-asyncio, nbval
- Docs group: mkdocs, mkdocs-material, mkdocstrings, mkdocstrings-python, mike, mkdocs-jupyter, mkdocs-autorefs, mkdocs-macros-plugin, mkdocs-table-reader-plugin, mkdocs-mermaid2-plugin, jupyter, notebook<7, commitizen, mkdocs-panzoom-plugin
Installing uv#
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Using pip (alternative)
pip install uv
Setting Up the Project (Recommended: uv)#
-
Create a virtual environment
This creates a.venvdirectory in your project root. -
Activate the virtual environment
-
Install the package (editable/local)
-
Optionally add development or docs tools
-
Run tests
-
Sync dependencies from
pyproject.toml
Install from GitHub#
uv pip install "git+https://github.com/serapeum-org/serapeum.git"
# or a specific tag (example: v0.1.0)
uv pip install "git+https://github.com/serapeum-org/serapeum.git@v0.1.0"
Alternative: Using pip#
-
Create and activate a venv
-
Install the package (editable/local)
-
(Optional) Install dev/docs tools
- Note: dev/docs are defined as groups, not pip extras. With pip, install the needed packages manually according to
pyproject.toml. -
Example (partial):
-
Install from GitHub with pip
Common uv Commands#
- Install a new package:
- Update a package:
- Run Python scripts:
Syncing Provider Dev Dependencies#
Each workspace member (provider package/subpackage) has its own dev dependency group. The root-level uv sync --dev --active
only installs root-level dev dependencies.
To install a specific provider's dev dependencies (e.g. type stubs, test plugins), sync that package explicitly:
# Sync dev deps for a specific sub-package
uv sync --package serapeum-llama-cpp --dev --active
uv sync --package serapeum-ollama --dev --active
For example, serapeum-llama-cpp declares types-requests and types-tqdm in its dev group for mypy type checking. These are only installed when you sync that package:
# Install llama-cpp dev deps (includes type stubs for mypy)
uv sync --package serapeum-llama-cpp --dev --active
# Then run mypy
python -m mypy libs/providers/llama-cpp
Troubleshooting#
- Virtual environment not activating: Make sure you've created the virtual environment first:
- Package installation fails: Try clearing the cache:
- ImportError after installation: Ensure you've installed the package in editable mode:
Quick Check#
After installation, open Python and run:
Additional Resources#
- uv Documentation
- PEP 621 - Storing project metadata in pyproject.toml
- Project homepage: https://github.com/serapeum-org/serapeum
- Documentation: https://serapeum.readthedocs.io/