Skip to main content

MiniLlama (Python)

Private, local-first AI workspace for running GGUF language & vision models (llama.cpp), Image / Video / Music studios (ComfyUI), fast PC-to-Phone checkpoint conversion, and self-contained on-device Android inference.


Features

  • Modern Dark Chat Workspace: Sleek obsidian & emerald-sapphire web dashboard inspired by ChatGPT and Gemini — collapsible sidebar with instant search and floating More menu, centered pill composer with + tools popover, streaming responses, stop controls, and responsive phone layout with zero ads or subscription prompts.
  • First-Start Setup Questionnaire & Live Available-VRAM Model Recommender:
    • Measures real-time available (free) VRAM on your GPU (or available RAM on Android) before making any suggestions.
    • Fetches live trending Hugging Face models across LLMs (GGUF), Images, Video, and Music that actually fit your current hardware budget.
    • Works for both PC and Phone targets, with options to skip setup or enter any custom Hugging Face repo / model name manually.
  • Local LLM & Vision Chat: OpenAI-compatible (/v1/*) and Ollama-compatible (/api/*) local API on port 11434, automatic GGUF metadata inspection, vision mmproj pairing, and multi-engine support (llama.cpp, KoboldCpp, ik_llama.cpp).
  • Image, Video & Music Studios (ComfyUI):
    • Image Studio: Stable Diffusion (SD 1.5, SDXL, Illustrious, Flux, SD3), LoRAs, img2img, and optional upscaling with Hugging Face & Civitai downloads.
    • Video Studio: Local text-to-video and image-to-video workflows (Wan 2.2, LTX-Video).
    • Music Studio: Original song generation and audio-to-music covers using YuE2 (with SheetSage2 conditioning) and ACE-Step.
    • Automatic VRAM Handoff & Persistent Gallery: Automatically unloads the active LLM before running media jobs (and frees ComfyUI VRAM before loading an LLM) while saving all outputs in a browsable local gallery.
  • PC-to-Phone Fast LAN Transfer & Streaming Converter: On-the-fly streaming conversion of .safetensors checkpoints to FP8 (F8_E4M3), 4-Bit GGUF (Q4_0), or 8-Bit GGUF (Q8_0) over LAN with HTTP Range resume.
  • Self-Contained Android App (mobile/android/ -> MiniLlama.apk):
    • Runs GGUF LLMs and Stable Diffusion directly on Android via Vulkan GPU, CPU, Hybrid, or NPU modes.
    • Dynamic Phone Link QR & 6-digit code pairing with .local mDNS support and rotating LAN tokens.
    • Hardened mobile privacy: anonymous Mozilla/5.0 headers, reduced WebView User-Agent, and zero device metadata sent to external servers.
    • Built-in GitHub Releases Self-Updater: automatically checks minillama-dev GitHub Releases, verifies the APK SHA-256 checksum against SHA256SUMS.txt, and upgrades in place without needing a PC.
  • Performance Lab & Auto-Tune: Live hardware telemetry, multi-GPU layer split and loop-aware tensor placement, safe OOM KV-cache fallbacks (f16 -> q8_0 -> q4_0 without shrinking your context length), speculative decoding, and built-in benchmarking.

Installation

Option 1: Install via pip (Wheel, GitHub, or PyPI)

Because MiniLlama is packaged as a standard Python wheel (minillama-0.2.1-py3-none-any.whl), you can install it directly with pip:

# Directly from PyPI:
pip install minillama

# Or from a downloaded GitHub Release wheel:
pip install https://github.com/minillama-dev/minillama-py/releases/download/v0.2.1/minillama-0.2.1-py3-none-any.whl

# Or straight from the GitHub repository:
pip install git+https://github.com/minillama-dev/minillama-py.git

After installing via pip, download the optimal inference engine for your GPU and launch the app:

minillama update              # Download the best llama.cpp build for your GPU
minillama serve               # Start daemon + tray icon and open the dashboard

Why is the .whl only ~900 KB? A .whl file is a Deflate-compressed ZIP archive containing all 38 Python source modules, the full web dashboard, app icons, and package metadata (entry_points + dependencies). When you run pip install, pip automatically downloads the required Python libraries (requests, Pillow, psutil, pystray, gguf, cryptography, numpy) from PyPI. Heavy OS/GPU-specific runtimes (llama.cpp, ComfyUI + PyTorch) and AI model weights are downloaded on demand so the wheel stays tiny and cross-platform.

Installs an isolated .venv, MiniLlama, the best llama.cpp GPU build, the native Desktop App wrapper, and ComfyUI Media Studio automatically.

Windows:

install.bat

macOS / Linux:

chmod +x install.sh start_minillama.sh minillama.sh
./install.sh --add-path

Or run install.py directly on any OS with modular flags:

python install.py                    # Full modular install (Core + llama.cpp + Desktop App + ComfyUI)
python install.py --interactive      # Pick modules interactively
python install.py --no-comfyui       # Skip ComfyUI Media Studio
python install.py --no-engine        # Skip llama.cpp download
python install.py --no-desktop-app   # Skip Desktop App wrapper
python install.py --port 11500 --autostart --add-path --lan --start

Option 3: Portable Archive & Android APK

  • Portable Python Zip (minillama-py-portable.zip): Extract anywhere and run install.bat (Windows) or ./install.sh (macOS/Linux).
  • Android (MiniLlama.apk): Transfer or scan the QR code from the dashboard's Phone Link tab to install the companion on-device Android app.

Looking for a zero-Python native C++20 binary with graphical installers for Windows, macOS, and Linux? See the companion minillama-cpp repository.


Quick Usage

# Launch Desktop App
start_minillama_app.bat      # Windows
./start_minillama_app.sh     # macOS / Linux

# Or start daemon + tray + web dashboard (http://127.0.0.1:11434)
minillama serve

# Pull any GGUF directly from Hugging Face
minillama pull bartowski/Qwen2.5-7B-Instruct-GGUF:Q4_K_M

# Import existing Ollama or LM Studio models (uses hard links — zero extra disk space)
minillama import ollama
minillama import lmstudio

CLI Reference

Command Description
minillama serve [--no-tray] Start the daemon in the foreground (HTTP API, dashboard, and tray icon).
minillama daemon Run the background daemon (used by autostart).
minillama list List all local GGUF models and SD checkpoints.
minillama pull <user>/<repo>[:<quant>] Download a GGUF model (and vision mmproj if present) from Hugging Face.
minillama import ollama | lmstudio Import local models from Ollama or LM Studio via hard links.
minillama run <model> [prompt] [--ctx N] Load a model and open an interactive terminal chat or run a one-shot prompt.
minillama load <model> [--ctx N] Load a model into memory without opening terminal chat.
minillama unload Unload the active model and free VRAM/RAM while keeping the daemon running.
minillama ps / minillama status Show daemon health, loaded model, context size, and live GPU/VRAM usage.
minillama endpoints Display OpenAI- and Ollama-compatible local API URLs.
minillama image "<prompt>" [--image file] [--upscale] Generate or edit an image via ComfyUI (--aspect, --lora, --steps, --cfg).
minillama video "<prompt>" [--image file] [--res 720|1080] Generate a text-to-video or image-to-video clip via ComfyUI.
minillama music "<style>" [--lyrics ...] [--audio file] Generate a song or YuE2 music cover locally via ComfyUI.
minillama gallery [list | rm <id>] Browse or delete saved image, video, and music outputs.
minillama lan [status | on | off | rotate | rotation | code] Manage Phone Link LAN access, token rotation, .local URL, and 6-digit pairing codes.
minillama engine [list | set | update <id|all> | auto-update | tune] Manage llama.cpp, KoboldCpp, ik_llama.cpp, and ComfyUI.
minillama update Install the latest verified llama.cpp build (retains the newest two builds).
minillama config [show | get | set | reset] View or update runtime profiles, KV cache, speculation, threads, batch size, and ports.
minillama net list | allow | deny | firewall Inspect or edit the outbound host whitelist.
minillama autostart on | off Toggle daemon startup at OS login (never auto-loads a model).
minillama rm <model> [--trash] Delete a model (or move to _trash).
minillama stats [reset] View or reset peak tokens/second metrics.
minillama restart [--daemon] Reload the active model or restart the daemon.
minillama stop / minillama kill Gracefully stop the daemon or terminate tracked MiniLlama processes.
minillama selftest Run isolated self-tests for Phone Link, VRAM handoff, and media endpoints.

HTTP API

See API.md for full documentation of all OpenAI-compatible (/v1/*), Ollama-compatible (/api/*), Media/Gallery (/api/media/*), Recommender/Control/Updater (/minillama/*), and LAN Pairing endpoints.


Privacy, Memory & Architecture

  • 100% Local Inference: Prompts, images, audio, and videos are processed strictly on your hardware.
  • Zero Device Telemetry: Trending model recommendations query Hugging Face with generic anonymous headers (Mozilla/5.0), never sending hardware IDs, phone model strings, or personal paths.
  • Strict Outbound Whitelist: Outbound downloads go through minillama/net.py, enforcing an allowlist (*.huggingface.co, *.hf.co, *.github.com, *.githubusercontent.com), manual redirect validation, cross-host credential stripping, and SHA-256 verification.
  • Loopback by Default: Binds to 127.0.0.1 until you explicitly enable Phone Link (LAN mode) with rotating access tokens and short-lived 6-digit pairing codes.
  • Exact GGUF Context & Safe OOM Fallbacks: Uses the model's true GGUF context_length by default without silently shrinking it, stepping down KV cache precision (f16 -> q8_0 -> q4_0) on OOM.
  • Standard Data Locations (override via MINILLAMA_HOME):
    • Windows: %APPDATA%\MiniLlama (config) & %LOCALAPPDATA%\MiniLlama (engines, models, logs)
    • macOS: ~/Library/Application Support/MiniLlama
    • Linux: $XDG_CONFIG_HOME/minillama & $XDG_DATA_HOME/minillama

Building the Wheel & Publishing to PyPI

pip install build twine
python -m build --wheel          # Creates dist/minillama-0.2.0-py3-none-any.whl
twine upload dist/*.whl          # Publish to PyPI so anyone can run: pip install minillama

Running Tests

pytest -q

License

MIT — see LICENSE.

Metadata

Release files for minillama 0.2.1

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

Source distribution (sdist)

Source distribution for minillama 0.2.1
File Size Uploaded Provenance Actions
minillama-0.2.1.tar.gz 1.0 MB With provenance Details for minillama-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for minillama 0.2.1
File Interpreter ABI Platform Actions
minillama-0.2.1-py3-none-any.whl Python 3 none any Details for minillama-0.2.1-py3-none-any.whl

Total release size: 1.9 MB

Release files / minillama-0.2.1.tar.gz

Download URL minillama-0.2.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
c43b9d3a3d77a82612ee712d2fcd3efb51b37a25a2ac9b318a625fb7d6233f0f
BLAKE2b-256 checksum
How to use checksums
2e5fe5287e5e36d556d118ed66a673f596dec2599691ee2958ffc79f97ada035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 2, 2026.

Transparency log

Release files / minillama-0.2.1-py3-none-any.whl

Download URL minillama-0.2.1-py3-none-any.whl
Size 920.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3537fd6bea02667c87eeb2c684498106bf8ba9e814905ea348e3b58964f3d68b
BLAKE2b-256 checksum
How to use checksums
633e373bd69fec969cddbc80b3835e6b2dc8baf01f1f316ba0bdfcf14e22c24a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 2, 2026.

Transparency log

Security for minillama 0.2.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for minillama-0.2.1.tar.gz

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 Dec 2, 2026.

Transparency log

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.2.1 This release

2 release files Full 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