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

Release files for local-keep-ai-cli 1.28.15

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

Built distribution (wheel)

Table of built distributions (wheels) for local-keep-ai-cli 1.28.15
File Interpreter ABI Platform
local_keep_ai_cli-1.28.15-py3-none-any.whl Python 3 none any Details

Release files / local_keep_ai_cli-1.28.15-py3-none-any.whl

Download URL local_keep_ai_cli-1.28.15-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6c9862d656860e98c19095c2fd0e6fc59bbd3673d0c353842f68a522c2b4e134
BLAKE2b-256 checksum
How to use checksums
592f94e654ef20d61c0cf416cfb646fb285cb46320bf6f04b77fbae26dc12916
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

1.28.39

1 release file

1.28.38

1 release file

1.28.37

1 release file

1.28.36

1 release file

1.28.35

1 release file

1.28.34

1 release file

1.28.33

1 release file

1.28.32

1 release file

1.28.31

1 release file

1.28.30

1 release file

1.28.29

1 release file

1.28.28

1 release file

1.28.27

1 release file

1.28.26

1 release file

1.28.25

1 release file

1.28.24

1 release file

1.28.23

1 release file

1.28.22

1 release file

1.28.21

1 release file

1.28.20

1 release file

1.28.19

1 release file

1.28.18

1 release file

1.28.17

1 release file

1.28.16

1 release file

This release

1.28.15 This release

1 release file

1.28.14

1 release file

1.28.13

1 release file

1.28.12

1 release file

1.28.11

1 release file

1.28.9

1 release file

1.28.8

1 release file

1.28.7

1 release file

1.28.5

1 release file

1.28.4

1 release file

1.28.3

1 release file

1.28.2

1 release file

1.28.1

1 release file

1.28.0

1 release file

1.27.9

1 release file

1.27.8

1 release file

1.27.7

1 release file

1.27.6

1 release file

1.27.5

1 release file

1.27.4

1 release file

1.27.3

1 release file

1.27.2

1 release file

1.27.1

1 release file

1.27.0

1 release file

1.26.1

1 release file

1.25.2

1 release file

1.25.1

1 release file

1.24.1

1 release file

1.23.0

1 release file

1.22.15

1 release file

1.22.14

1 release file

1.22.13

1 release file

1.22.12

1 release file

1.22.11

1 release file

1.22.10

1 release file

1.22.9

2 release files

1.22.8

1 release file

1.22.7

1 release file

1.22.5

1 release file

1.22.4

1 release file

1.22.3

1 release file

1.22.2

1 release file

1.22.0

1 release file

1.21.44

1 release file

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