Skip to main content

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

Purpose examples

purpose= Use when you want… Example models (if they fit your RAM)
"all" Every runnable model on this machine (default — no filter)
"general" Chat, writing, everyday tasks llama3.2, gemma2, mistral
"coding" Code generation, debugging, SQL qwen2.5-coder, codellama, deepseek-coder
"reasoning" Math, logic, chain-of-thought deepseek-r1, qwq
"vision" Image understanding, multimodal llava, llama3.2-vision
"embedding" Vector search / RAG indexes nomic-embed-text, mxbai-embed-large
"audio" Speech-to-text whisper
# Top 5 coding models that fit this machine
oa.recommend(purpose="coding", top_n=5)

# Reasoning models, return as a plain list instead of DataFrame
oa.recommend(purpose="reasoning", as_dataframe=False)

# Refresh catalog from ollama.com, then filter for vision
oa.recommend(purpose="vision", force_refresh=True)

# Embedding-only models (excludes general chat models)
oa.recommend(purpose="embedding")

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
ollama-advisor snapshot --force-refresh

Daily catalog snapshot

GitHub Actions (catalog-daily.yml) crawls ollama.com/library once per day and commits CSV/JSON under data/catalog/.

ollama-advisor snapshot --output data/catalog --force-refresh

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, then ollama 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

recommend() works without Ollama. For pull_model / run_model / list_installed, call setup_colab_ollama() once per runtime:

!pip install -q ollama-advisor

import ollama_advisor as oa

# Recommendations — no Ollama server needed
oa.recommend(purpose="coding", top_n=5)

# Install + start Ollama in this Colab VM (installs zstd, then Ollama, then serve)
oa.setup_colab_ollama()

# Then pull / run (small models work best on free Colab RAM)
oa.pull_model("qwen2.5-coder:0.5b")
print(oa.run_model("qwen2.5-coder:0.5b", prompt="hello"))

Colab does not keep Ollama running after the runtime disconnects — models and server state 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
colab.py setup_colab_ollama() — install/start Ollama in Google Colab only
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

  1. Create an account at pypi.org
  2. Confirm the name ollama-advisor is available (alternatives: ollama-model-advisor)
  3. The project is created on first upload, or when using Trusted Publisher

2. Trusted Publisher (OIDC)

  1. PyPI → Account settings → Publishing → Add a new pending publisher
  2. Configure:
    • PyPI project name: ollama-advisor
    • Owner: GitHub user or organization
    • Repository name: ollama-advisor
    • Workflow name: publish.yml
    • Environment name: pypi (create a pypi environment in GitHub repo Settings → Environments)
  3. 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

Automatic (preferred): bump version in pyproject.toml (and __version__), merge to main.
Workflow release-on-version.yml creates tag vX.Y.Z + GitHub Release → publish.yml uploads to PyPI.

Manual fallback:

git tag v0.1.2
git push origin v0.1.2

Publish a GitHub Release for that tag (or let the automation create it). Then:

  1. publish.yml runs pytest as a gate
  2. On success, uploads wheel/sdist to PyPI

Manual local upload (debugging only):

python -m build
twine upload dist/*

📦 Download Stats

Metric Count
Today (2026-08-25) 2
Total (cumulative) 1,328

Updated daily via GitHub Actions

License

MIT — see LICENSE

Release files for ollama-advisor 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ollama-advisor 0.1.4
File Size Uploaded
ollama_advisor-0.1.4.tar.gz 242.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ollama-advisor 0.1.4
File Interpreter ABI Platform
ollama_advisor-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 262.6 kB

Release files / ollama_advisor-0.1.4.tar.gz

Download URL ollama_advisor-0.1.4.tar.gz
Size 242.1 kB
Tags Source
SHA-256 checksum
How to use checksums
50a02445a9698194be29cb48d8d9c5d9c887cde1a62fbed13829626701e42948
BLAKE2b-256 checksum
How to use checksums
319de020aff95f2b2405820472ea27dc027de19ce082ec0aabdc4a6a36b85849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / ollama_advisor-0.1.4-py3-none-any.whl

Download URL ollama_advisor-0.1.4-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68a14ecc9216cae7a00454f90291cc64b52fd2535949679c8e7f2f880e5b6285
BLAKE2b-256 checksum
How to use checksums
1b51f25ae6309192cb2ed7bd02277bc1135bc81c8205d45eb4671b590f8f12b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page