Metadata-Version: 2.4
Name: local-keep-ai-cli
Version: 1.22.11
Summary: Local Keep AI — a local-first AI coding CLI (like Claude Code, using free/open models)
Author: Layne Faler
License: MIT
Project-URL: Homepage, https://localkeep.ai
Project-URL: Repository, https://github.com/laynef/claude-ai-clone
Keywords: ai,cli,llm,coding,local,gemini,gguf,llama
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: prompt-toolkit>=3.0.43
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
Requires-Dist: websocket-client>=1.6.0
Requires-Dist: cryptography>=41.0.0
Provides-Extra: local
Requires-Dist: llama-cpp-python>=0.2.90; extra == "local"
Provides-Extra: server
Requires-Dist: fastapi>=0.115.0; extra == "server"
Requires-Dist: uvicorn[standard]>=0.30.0; extra == "server"
Requires-Dist: pydantic>=2.9.0; extra == "server"
Requires-Dist: pydantic-settings>=2.5.0; extra == "server"
Requires-Dist: python-multipart>=0.0.6; extra == "server"
Requires-Dist: firebase-admin>=6.0.0; extra == "server"
Requires-Dist: google-cloud-firestore>=2.16.0; extra == "server"
Requires-Dist: google-cloud-storage>=2.14.0; extra == "server"
Requires-Dist: pyjwt>=2.8.0; extra == "server"
Requires-Dist: requests>=2.31.0; extra == "server"
Provides-Extra: voice
Requires-Dist: aiortc<2.0.0,>=1.9.0; extra == "voice"
Requires-Dist: av<13.0.0,>=12.0.0; extra == "voice"
Provides-Extra: all
Requires-Dist: llama-cpp-python>=0.2.90; extra == "all"
Requires-Dist: fastapi>=0.115.0; extra == "all"
Requires-Dist: uvicorn[standard]>=0.30.0; extra == "all"
Requires-Dist: pydantic>=2.9.0; extra == "all"
Requires-Dist: pydantic-settings>=2.5.0; extra == "all"
Requires-Dist: python-multipart>=0.0.6; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.3.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
Requires-Dist: respx>=0.21.0; extra == "dev"
Requires-Dist: anyio>=4.0; extra == "dev"

# 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.**

```bash
pip install local-keep-ai-cli
```

No npm. No Docker. No subscription required.

[![PyPI](https://img.shields.io/pypi/v/local-keep-ai-cli.svg)](https://pypi.org/project/local-keep-ai-cli/)
[![Python](https://img.shields.io/pypi/pyversions/local-keep-ai-cli.svg)](https://pypi.org/project/local-keep-ai-cli/)
[![License](https://img.shields.io/pypi/l/local-keep-ai-cli.svg)](https://github.com/laynef/claude-ai-clone)

---

## Quickstart

After install, the command is `lk`.

### Fastest path — a free hosted model

```bash
# 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

```bash
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

```bash
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**.

```bash
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:

```bash
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:

```bash
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

```bash
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.

- Homepage: <https://localkeep.ai>
- Source: <https://github.com/laynef/claude-ai-clone>

---

## License

MIT
