feat(cli): ollama-parity — tq pull/list/run/serve#42
Merged
Conversation
Addresses Reddit feedback (smahs9, Eyelbee): the embedded niche is
real, but developer experience was behind ollama's "one command to
chat" standard. This adds that layer without touching any C code.
New subcommands in tools/tq:
- tq pull MODEL — download from HuggingFace by short alias
(e.g., llama3.2:1b) to ~/.cache/quantcpp/
- tq list — show cached + available models with aliases
(supports --json for scripting)
- tq run MODEL — auto-pull + interactive chat via ./build/quant
- tq serve MODEL — auto-pull + OpenAI API server via quant-server
Short aliases added:
- smollm2 / smollm2:135m → SmolLM2-135M
- qwen3.5 / qwen3.5:0.8b → Qwen3.5-0.8B
- llama3.2 / llama3.2:1b → Llama-3.2-1B
Implementation approach:
- Zero C changes — entirely a Python shim in tools/tq
- Reuses existing bindings/python quantcpp._MODEL_REGISTRY and
quantcpp.download() (which already has progress bar + cache)
- Subprocess-invokes ./build/quant and ./build/quant-server
- Accepts local .gguf paths as well as registry aliases
Verified end-to-end:
- tq list (shows cached/remote status + aliases)
- tq pull llama3.2:1b (downloads 770 MB with progress bar)
- tq run smollm2:135m "prompt" (31 tok/s single-thread)
- tq serve smollm2:135m --port 8766 (OpenAI /health + /v1/models work)
Also: made numpy import optional (was top-level, broke non-bench
commands if numpy wasn't installed).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
unamedkr
added a commit
that referenced
this pull request
Apr 11, 2026
PR #42 added these commands to tools/tq, but that's only available to people who clone the repo. For PyPI users running `pip install quantcpp`, the entry point is `quantcpp = quantcpp.cli:main`, which only had a single chat shortcut. This adds proper ollama-style subcommands to bindings/python/quantcpp/ cli.py so PyPI users get the same DX: pip install quantcpp quantcpp pull llama3.2:1b quantcpp list quantcpp run llama3.2:1b quantcpp serve llama3.2:1b --port 8080 Short aliases (smollm2:135m, qwen3.5:0.8b, llama3.2:1b) match the tools/tq registry. Backwards-compatible: bare `quantcpp` and `quantcpp "question"` still work. Bumped version 0.11.0 → 0.12.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
unamedkr
added a commit
that referenced
this pull request
Apr 11, 2026
PR #42 added these commands to tools/tq, but that's only available to people who clone the repo. For PyPI users running `pip install quantcpp`, the entry point is `quantcpp = quantcpp.cli:main`, which only had a single chat shortcut. This adds proper ollama-style subcommands to bindings/python/quantcpp/ cli.py so PyPI users get the same DX: pip install quantcpp quantcpp pull llama3.2:1b quantcpp list quantcpp run llama3.2:1b quantcpp serve llama3.2:1b --port 8080 Short aliases (smollm2:135m, qwen3.5:0.8b, llama3.2:1b) match the tools/tq registry. Backwards-compatible: bare `quantcpp` and `quantcpp "question"` still work. Bumped version 0.11.0 → 0.12.0. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses Reddit feedback from smahs9 ("stop justifying, focus on embedded use case") and Eyelbee ("why not just llama.cpp?"). The embedded niche is real but DX was behind ollama's standard. This closes the gap with zero C code changes — pure Python shim over existing bindings.
New commands
```bash
tq pull llama3.2:1b # download 770 MB from HuggingFace with progress bar
tq list # see cached + available models
tq run llama3.2:1b # auto-pull + interactive chat
tq serve llama3.2:1b # auto-pull + OpenAI-compatible HTTP server on :8080
```
Short aliases
Verified end-to-end
🤖 Generated with Claude Code