Skip to main content

llm-nest

English | 中文

Local LLM runtime and GGUF model management tool. Think of it as ollama for your terminal — lightweight, offline-first, no daemon required.

Features

  • Model management — search, download, list, and delete GGUF models from HuggingFace Hub
  • Interactive chat — REPL mode with multi-turn conversation and streaming output
  • API server — OpenAI-compatible /v1/chat/completions endpoint with SSE streaming

Install

pip install llm-nest-python

With API server support (FastAPI + uvicorn):

pip install llm-nest-python[server]

From source (uv)

git clone https://github.com/NingCold/llm-nest-python.git
cd llm-nest-python
uv sync
uv run llmn --help

Quick Start

Download a model

llmn hub get tensorblock/tinyllama-15M-GGUF -f tinyllama-15M-Q4_K_M.gguf

List local models

llmn model list

Run interactive chat

llmn run tinyllama-15M-Q4_K_M
Loading model: tinyllama-15M-Q4_K_M (Q4_K_M, 0.0GB) ...
Type 'exit' or press Ctrl+C to quit

You: Hello
Assistant: Hello! How can I help you?

You: exit
Bye!

Single-shot inference

llmn run tinyllama-15M-Q4_K_M -p "What is 2+2?" --max-tokens 50

With system prompt

llmn run tinyllama-15M-Q4_K_M -s "You are a helpful assistant."

API Server

Start an OpenAI-compatible HTTP server:

llmn serve tinyllama-15M-Q4_K_M --port 8000

Endpoints

Endpoint Method Description
/health GET Health check
/v1/models GET List loaded models
/v1/chat/completions POST Chat completion (stream + non-stream)

Usage with curl

# Non-streaming
curl http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello"}]}'

# Streaming (SSE)
curl http://127.0.0.1:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello"}], "stream": true}'

Usage with OpenAI Python SDK

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="none")
resp = client.chat.completions.create(
    model="tinyllama-15M-Q4_K_M",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Commands

llmn model list                          # List local models
llmn model search <query>                # Search local + Hub models
llmn model info <name>                   # Show model details
llmn model remove <name>                 # Delete a local model

llmn hub search <query>                  # Search HuggingFace Hub
llmn hub get <repo_id> [-f filename]     # Download model from Hub

llmn run <model> [-p prompt] [-s system] # Interactive chat or single-shot
llmn serve <model> [--port 8000]         # Start API server

llmn lang zh                             # Switch to Chinese
llmn lang en                             # Switch to English
llmn version                             # Show version

Storage

Models are stored in ~/.llmn/models/. Config is at ~/.config/llm-nest/config.json.

Development

uv sync
uv run pytest
uv run ruff check .
uv run pyright

License

MIT

Metadata

Release files for llm-nest-python 0.1.0

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

Source distribution (sdist)

Source distribution for llm-nest-python 0.1.0
File Size Uploaded Provenance Actions
llm_nest_python-0.1.0.tar.gz 97.1 kB Without provenance Details for llm_nest_python-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llm-nest-python 0.1.0
File Interpreter ABI Platform Actions
llm_nest_python-0.1.0-py3-none-any.whl Python 3 none any Details for llm_nest_python-0.1.0-py3-none-any.whl

Total release size: 128.8 kB

Release files / llm_nest_python-0.1.0.tar.gz

Download URL llm_nest_python-0.1.0.tar.gz
Size 97.1 kB
Tags Source
SHA-256 checksum
How to use checksums
80caf4f43976f7d6d2e037edc387eab08b2ffd0c00ff7b8a4b0b294f5e357b7a
BLAKE2b-256 checksum
How to use checksums
fa365b5b9ecec42f99a9bc947b89174c8fb986aee2e02b6ec5f3067cf4804279
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / llm_nest_python-0.1.0-py3-none-any.whl

Download URL llm_nest_python-0.1.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de1fa1b2cdbe799600110950484091c8ea155999462caa111fad708ae48e10ad
BLAKE2b-256 checksum
How to use checksums
bf67fc5b037704f2673bbf11575d1dc6e6253ee18dd6bf5fd440bc3fd0b2528f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for llm-nest-python 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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