Skip to content

feat(cli): ollama-parity — tq pull/list/run/serve#42

Merged
unamedkr merged 1 commit intomainfrom
feat/cli-ollama-parity
Apr 11, 2026
Merged

feat(cli): ollama-parity — tq pull/list/run/serve#42
unamedkr merged 1 commit intomainfrom
feat/cli-ollama-parity

Conversation

@unamedkr
Copy link
Copy Markdown
Collaborator

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

Alias Canonical Size
`smollm2:135m` SmolLM2-135M 138 MB
`qwen3.5:0.8b` Qwen3.5-0.8B 508 MB
`llama3.2:1b` Llama-3.2-1B 770 MB

Verified end-to-end

  • `tq list` — shows cached/remote status + aliases (+ `--json`)
  • `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` — `/health` + `/v1/models` responding

🤖 Generated with Claude Code

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 unamedkr merged commit 4a7c14e into main Apr 11, 2026
@unamedkr unamedkr deleted the feat/cli-ollama-parity branch April 11, 2026 05:19
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant