Skip to main content

Local Keep AI

An AI coding CLI that runs on your own machine, hands back real files, and cannot run up a bill you did not agree to.

pip install local-keep-ai-cli

No npm. No Docker. No subscription required.

PyPI Python License


Quickstart

After install, the command is lk.

Fastest path — a free hosted model

# Get a free OpenRouter key (no billing required) at openrouter.ai/keys
export SAGE_OPENROUTER_API_KEY="sk-or-v1-..."

lk ask "build a TODO app" --out ./my-todo --model openrouter:qwen/qwen3-coder:free

Offline path — a local model, no network at all

lk install                       # installs the Ollama runtime and default models
lk ask "build a TODO app" --out ./my-todo --model ollama:qwen3:latest

lk install is safe to re-run — already-installed pieces are skipped.

Interactive

lk run          # interactive coding agent: READ / SEARCH / edit / run

lk run is the REPL, and where the slash commands below live.


Why this instead of a hosted coding assistant

It keeps working with the network off. Local GGUF inference runs in-process. The offline test suite does not merely check that a model loads — it blocks the network at the OS level, generates real text, then re-inspects the OS socket table to prove the process held no network socket while the model was resident.

Your code stays yours. With a local model, prompts and source never leave the machine. Nothing is uploaded for training.

It writes real files. Output is a working tree on disk you can cd into, run, and commit — not a chat transcript you copy out of a browser tab.

Predictable cost. Local models cost nothing to run. Hosted models are opt-in per invocation via --model.


Models

Over 1,100 models in the catalogue — roughly 466 you can run on your own machine and 667 hosted.

lk models                      # list models from all configured providers
lk models --ollama             # everything available to pull from Ollama
lk models --category coding    # coding, reasoning, general, vision, small, embedding
lk models --search qwen        # search the catalogue
lk models --details            # full descriptions, with pros and cons

Download and register a local GGUF model:

lk pull <model>       # download a GGUF from the shared bucket — no API key needed
lk train <model>      # register a downloaded GGUF for use
lk use <model>        # set it as the default
lk rm <model>         # remove it and free the disk space

The number of models you actually see is device-dependent: entries that neither your machine nor the server it is talking to can run are hidden.


Commands

Command What it does
lk ask Ask a question, or run a one-shot task
lk run Interactive coding agent — read, search, edit, run
lk search Web search with multi-model synthesis and cited sources
lk image Generate an image with Vertex AI Imagen
lk models List available models from every configured provider
lk install Set up Local Keep AI on a fresh machine
lk pull · lk train · lk train-all · lk use · lk rm Manage local GGUF models
lk sync · lk sync-catalog Sync models and refresh the catalogue
lk mcp Run an MCP server over stdio (Zed, Claude Desktop, …)
lk rag · lk corpus · lk ext Local RAG, shared corpus, extensions
lk integrate Connected service integrations
lk schedule · lk daemon Scheduled tasks and the remote agent daemon
lk sms Control a Local Keep AI machine from iMessage or Google Messages
lk config · lk secrets Configuration, secrets and .env hygiene
lk login · lk logout · lk whoami Account
lk update Update to the latest published release
lk fix-llama-cpp Rebuild llama-cpp-python with GPU acceleration for this machine

Run lk --help, or any subcommand with --help, for the full reference.

Autonomous commands

Long-running loops that work with little to no human input:

lk autopilot "ship the checkout flow"      # autonomous build loop
lk autofleet "migrate the API to async"    # autonomous fleet loop
lk autoorg   "raise test coverage"         # autonomous organisation loop

Inside lk run, the equivalents are /autopilot (stop it with /autopilot-stop), /autofleet, /autoorg and /swarm.

Releases up to 1.22.1 shipped these as autopolit / /autopolit, a misspelling. The old spelling still works as a hidden alias so existing scripts keep running, but it is deprecated — use autopilot.

REPL slash commands

Available inside lk run:

/help /model /models /context /files /read /rag /think /expert /phd /confidence /tdd /test /sandbox /undo /history /compact /clear /status /system /version /update


Install options

pip install local-keep-ai-cli            # CLI — fast, pure-Python install
pip install "local-keep-ai-cli[local]"   # + in-process GGUF inference
pip install "local-keep-ai-cli[server]"  # + FastAPI backend
pip install "local-keep-ai-cli[voice]"   # + WebRTC voice
pip install "local-keep-ai-cli[all]"     # everything

Requires Python 3.9+.

The base install is deliberately light. In-process GGUF inference needs llama-cpp-python, which compiles from source and wants a C++ toolchain, so it lives in the [local] extra rather than taxing every install with a multi-minute build. Everything else — hosted models, Ollama, RAG, the agent — works without it. If a GGUF model reports itself unavailable, that extra is what you are missing; lk fix-llama-cpp rebuilds it with GPU acceleration for your machine.

pipx install local-keep-ai-cli is recommended if you want the CLI isolated from your project environments.

The commands localkeep, sage and sage-cli are installed as aliases of lk, so existing scripts, shell history and editor integrations keep working.


Configuration

Variable Purpose
SAGE_OPENROUTER_API_KEY OpenRouter key for hosted models

Use lk config to view and set options, and lk secrets for credential storage and .env hygiene.


Also available on

Web, iOS, Android, macOS, Windows, Linux, an SMS bridge, and editor integrations for VS Code, JetBrains, Zed, Sublime Text, Neovim, Cursor, Unity and Godot.


License

MIT

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

local_keep_ai_cli-1.22.8-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file local_keep_ai_cli-1.22.8-py3-none-any.whl.

File metadata

File hashes

Hashes for local_keep_ai_cli-1.22.8-py3-none-any.whl
Algorithm Hash digest
SHA256 044145a0b61b5bf45df12c63824cd78b1e749f37cebaed0471c0ac8f8f5091ad
MD5 5fe267cce6f838d57d198503067a32b6
BLAKE2b-256 2e927000e1ddc6d6da062b5fcc2ec3707d9f79d0b9bbb14d65cc6d167984dad2

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 Sentry Error logging StatusPage Status page