Skip to main content

NativeLab AI framework

Project description

NativeLab

NativeLab

A fully local, privacy-first LLM workbench powered by llama.cpp - desktop GUI, terminal CLI, and an experimentation layer.

PyPI version PyPI downloads Python License: AGPL v3 Platform Powered by llama.cpp GitHub stars GitHub PRs Last commit Issues Contributors GitHub clones


NativeLab is a desktop and terminal client for running large language models entirely on your machine. No API keys, no cloud, no data leaving your computer. It wraps llama.cpp behind a polished PyQt6 GUI and a Claude-Code-style terminal CLI, with first-class support for multi-model pipelines, document references, long-document summarization, and a brand-new Labs experimentation layer.

pip install nativelab
nativelab            # GUI
nativelab --cli      # terminal client (interactive setup → chat)

✨ Highlights

  • 🖥️ Desktop GUI - Chat, model library, visual pipeline builder, MCP, HuggingFace downloader, Labs, theming.
  • ⌨️ Terminal CLI - nativelab --cli opens an interactive setup wizard, downloads a model, and drops you straight into a chat REPL with @file embedding, slash commands, and built-in linting.
  • 🧪 Labs - A dedicated experimentation layer with a shared endpoint API. New lab features get engine status, model swap, context change, and LLM calls for free.
  • 🔗 Visual Pipeline Builder - 20 node types (model, transform, branch, loop, custom Python), live execution log, save/load.
  • 🌐 API + local mixing - OpenAI-compatible and Anthropic endpoints work side-by-side with local GGUFs.
  • Parallel + pipeline mode - Run reasoning + coding engines simultaneously and chain them automatically.
  • 🧠 Auto family detection - 20+ model families recognised from filename; correct prompt template applied.
  • 📦 HuggingFace downloader - Search any GGUF repo and pull files without leaving the app.

See docs/features.md for the full v0.2.9 changelog and docs/architecture.md for the layered design.


📚 Documentation

The docs are split into short, focused files so you can jump straight to what you need.

Page What's inside
docs/README.md Documentation index with one-line summaries.
docs/installation.md Install, llama.cpp setup, first-time workspace.
docs/cli.md nativelab --cli - quick reference + link to the beginner guide.
docs/features.md What's new in v0.2.9 + the full feature catalogue.
docs/architecture.md Layered architecture, project structure, data flow.
docs/labs.md The Labs experimentation layer + how to add a feature.
docs/models.md Model registry, families, quantization, API models.
docs/workflows.md Pipelines, references, summarization, MCP, HF downloads.
docs/ui.md GUI tour, theming, shortcuts, data persistence.
docs/troubleshooting.md Common errors and their fixes.

Beginner-friendly walkthroughs:


⚡ Quick start

GUI

pip install nativelab
nativelab

The first launch opens the desktop app. Use the Download tab to install llama.cpp binaries and grab a GGUF model - no manual setup required.

CLI

pip install nativelab
nativelab --cli

The CLI runs an interactive wizard the first time:

  1. Verifies llama-server / llama-cli are present (or guides you to install them).
  2. Lets you pick or download a GGUF model from HuggingFace.
  3. Asks for a context size with sensible defaults.
  4. Drops you into a chat REPL with @file embedding and slash commands.
you ▸ explain what @nativelab/labs/endpoints.py does
bot ▸ It's the shared surface every Labs panel uses to talk to engines…
you ▸ /lint nativelab/cli/chat.py
✓  [pyflakes]  nativelab/cli/chat.py - clean
you ▸ /quit

Full beginner walkthrough: nativelab/cli/cli_guide.md.


🧪 Labs - the experimentation layer

The nativelab/labs/ package is a sandbox for new features. Every lab panel receives a single LabEndpoints instance and uses it for all engine interaction:

from nativelab.labs import LabEndpoints

# Read state
endpoints.status_text     # "🟢 Server  :8612"
endpoints.model_path      # "/abs/path/to/mistral-7b.Q4_K_M.gguf"
endpoints.snapshot()      # {model_name, ctx_value, server_port, …}

# Synchronous LLM call - auto-routes API > server > CLI
endpoints.call_llm(messages=[...], system_prompt="…")

# Reverse routing - ask the host app to change state
endpoints.request_load_model("/path/to/other.gguf")
endpoints.request_context(8192)
endpoints.request_unload()

Add a lab feature by dropping nativelab/labs/<feature>.py with a QWidget panel that has LAB_NAME, LAB_ICON, and a set_endpoints(...) method, then appending it to LAB_FEATURES. Full guide in docs/labs.md.


🛠️ Requirements

  • Python 3.10+
  • PyQt6 (installed automatically as a dependency)
  • llama.cpp binaries - llama-server / llama-cli. The GUI's Download tab installs these for you, or you can drop them in ./llama/bin/.
  • Optional: psutil (RAM monitor), PyPDF2 (PDF summarization), pyflakes / flake8 / pylint (CLI lint).

Detailed instructions in docs/installation.md.


🤝 Contributing

Issues and PRs welcome. See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

For security disclosures, see SECURITY.md.


📜 License

AGPL v3 - see LICENSE. NativeLab depends on llama.cpp (MIT) and PyQt6 (GPL/commercial).


Built for people who want their LLMs local, fast, and under their own control.

Install from PyPI · GitHub · Docs · Issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nativelab-0.2.9.tar.gz (407.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nativelab-0.2.9-py3-none-any.whl (433.8 kB view details)

Uploaded Python 3

File details

Details for the file nativelab-0.2.9.tar.gz.

File metadata

  • Download URL: nativelab-0.2.9.tar.gz
  • Upload date:
  • Size: 407.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nativelab-0.2.9.tar.gz
Algorithm Hash digest
SHA256 c3f323e022ce259afb4a2b07211854d9d339a4e176febf03d95a34990350cfa7
MD5 2054428dd3620a05c4f02ab5af07c619
BLAKE2b-256 c8c862e4b9841a9a752ef6683c420e2016f1ca78989220ab2f2fdd9e2434ac72

See more details on using hashes here.

File details

Details for the file nativelab-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: nativelab-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 433.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nativelab-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a09fe5dc61cbf712cb37d5a33d989d1b046fd54cf08ae632d573209bc61b430e
MD5 991fa79dac81973ffcaf2eb7018e5166
BLAKE2b-256 141192c0300fc50656aed6853de1094247c755104f7a4368d8dfb10f7c80b0e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page