ollama-advisor
A Python library that recommends Ollama models you can run on your machine, based on system specs (RAM, GPU VRAM) and use case (coding, reasoning, vision, embedding, audio, general). It also supports downloading, running, and stopping models.
Works on Mac, Windows, Linux, and Google Colab.
Korean documentation: README.ko.md
Installation
pip install ollama-advisor
Local development install:
git clone https://github.com/dschloe/ollama-advisor.git
cd ollama-advisor
pip install -e ".[dev]"
Quick Start
import ollama_advisor as oa
oa.recommend() # Full recommendations (returns a DataFrame)
oa.recommend(purpose="coding") # Filter for coding models only
oa.pull_model("qwen2.5-coder:7b") # Download a model
oa.run_model("qwen2.5-coder:7b", prompt="hello") # Single-shot (non-interactive) run
oa.stop_model("qwen2.5-coder:7b") # Stop / unload a running model
oa.list_installed() # List locally installed models
CLI:
ollama-advisor recommend --purpose coding
ollama-advisor pull qwen2.5-coder:7b
ollama-advisor run qwen2.5-coder:7b --prompt "hello"
ollama-advisor stop qwen2.5-coder:7b
ollama-advisor list
ollama-advisor ps
ollama-advisor specs
Prerequisites: Ollama
recommend() and get_system_specs() work without Ollama installed.
pull_model, run_model, stop_model, list_installed, and related commands require a local Ollama server.
- Download: https://ollama.com/download
- macOS:
brew install ollama, thenollama serve(or launch the app) - Windows: run the installer, then start the tray app
- Linux:
curl -fsSL https://ollama.com/install.sh | sh
If the Ollama server is not running, an OllamaError is raised with platform-specific setup instructions (error messages in the library may be localized).
Google Colab limitations
Colab does not officially support keeping Ollama running as a persistent background service. You can start it temporarily:
!curl -fsSL https://ollama.ai/install.sh | sh
!nohup ollama serve > ollama.log 2>&1 &
When the runtime shuts down, downloaded models and server state are reset.
In notebooks and Colab, recommend() automatically displays a scrollable HTML table.
How it works
| Module | Role |
|---|---|
system.py |
Detect RAM/GPU/platform; compute usable memory (80% of available) |
catalog.py |
Crawl ollama.com/library; cache at ~/.ollama_advisor_cache.json (6h TTL) |
purpose.py |
Classify models: coding / reasoning / vision / embedding / audio / general |
core.py |
recommend() — combine specs, catalog, and purpose |
ctl.py |
Wrapper around the official ollama Python client |
Memory estimate (approx. 4-bit quantization): required_gb = billions × 0.6 + 1.0
Development & testing
pip install -e ".[dev]"
pytest tests/ -v
CI (test.yml) runs on Ubuntu / Windows / macOS with Python 3.9 and 3.11. Network crawling is mocked in tests.
PyPI publishing (maintainers)
1. PyPI project
- Create an account at pypi.org
- Confirm the name
ollama-advisoris available (alternatives:ollama-model-advisor) - The project is created on first upload, or when using Trusted Publisher
2. Trusted Publisher (OIDC)
- PyPI → Account settings → Publishing → Add a new pending publisher
- Configure:
- PyPI project name:
ollama-advisor - Owner: GitHub user or organization
- Repository name:
ollama-advisor - Workflow name:
publish.yml - Environment name:
pypi(create apypienvironment in GitHub repo Settings → Environments)
- PyPI project name:
- Optionally add deployment protection rules under GitHub → Settings → Environments →
pypi
The workflow in .github/workflows/publish.yml uses pypa/gh-action-pypi-publish with OIDC—no API token required in CI.
3. Release
git tag v0.1.1
git push origin v0.1.1
Publish a GitHub Release for tag v0.1.1. Then:
publish.ymlrunspytestas a gate- On success, uploads wheel/sdist to PyPI
Manual local upload (debugging only):
python -m build
twine upload dist/*
License
MIT — see LICENSE
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ollama_advisor-0.1.1.tar.gz.
File metadata
- Download URL: ollama_advisor-0.1.1.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b05ac17a9d1b3208da12a297ecf06956c28624116badeb8bdc03e4b9b9bb722
|
|
| MD5 |
c1c50801412aa4972e2a7ae60ab53557
|
|
| BLAKE2b-256 |
309c39d45a363924150a706b4c794cf6c6df0201f850819c9820a16db9b5cb56
|
Provenance
The following attestation bundles were made for ollama_advisor-0.1.1.tar.gz:
Publisher:
publish.yml on dschloe/ollama-advisor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ollama_advisor-0.1.1.tar.gz -
Subject digest:
5b05ac17a9d1b3208da12a297ecf06956c28624116badeb8bdc03e4b9b9bb722 - Sigstore transparency entry: 2436838947
- Sigstore integration time:
-
Permalink:
dschloe/ollama-advisor@2c74a8aeff7f4f9f837ab07b66d05023ce604af6 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dschloe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c74a8aeff7f4f9f837ab07b66d05023ce604af6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ollama_advisor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ollama_advisor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff77bd5c659abe69e10314f07ea51b061f0c08eb11bb193630738a9f7c1874c3
|
|
| MD5 |
d5dd292994cadd7160fa1dc9af233c73
|
|
| BLAKE2b-256 |
4d9b062aac766abcdee02ae002e99b90479125d3ec878e0635c5fadded8abfce
|
Provenance
The following attestation bundles were made for ollama_advisor-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on dschloe/ollama-advisor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ollama_advisor-0.1.1-py3-none-any.whl -
Subject digest:
ff77bd5c659abe69e10314f07ea51b061f0c08eb11bb193630738a9f7c1874c3 - Sigstore transparency entry: 2436839402
- Sigstore integration time:
-
Permalink:
dschloe/ollama-advisor@2c74a8aeff7f4f9f837ab07b66d05023ce604af6 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dschloe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c74a8aeff7f4f9f837ab07b66d05023ce604af6 -
Trigger Event:
release
-
Statement type: