Skip to content
This repository was archived by the owner on Sep 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
dd7d344
docs: add CLAUDE.md for Claude Code guidance
geekaholic Jun 2, 2026
e2a6e5c
Add MLX-free proxy gateway
geekaholic Jun 3, 2026
edde5ca
Add proxy backend metrics visibility
geekaholic Jun 3, 2026
96ded58
Rebrand README and UI as oMNI
geekaholic Jun 3, 2026
887d2ad
Update chat branding and logos
geekaholic Jun 3, 2026
972ca03
Add proxy backend runtime controls
geekaholic Jun 3, 2026
92db75f
Add generated vLLM compose support
geekaholic Jun 4, 2026
f8390c3
Add omni compose management CLI
geekaholic Jun 6, 2026
86ad7e3
Add file-backed vLLM admin settings and stop command
geekaholic Jun 6, 2026
d732e8c
Add omni vLLM config persistence
geekaholic Jun 6, 2026
2947926
Refresh Linux proxy documentation
geekaholic Jun 6, 2026
7a6a7ff
Fix claude code launch integration
geekaholic Jun 6, 2026
8f4871e
Add omni launch command and Responses API adapter for Codex
geekaholic Jun 6, 2026
f2ed8a3
Update omni serve defaults and root redirect
geekaholic Jun 7, 2026
c6918cb
Add llama.cpp managed sidecar and OMNI_* portable settings
geekaholic Jun 10, 2026
461af83
Remove ollama backend type, add per-backend profiles, sidecar restart…
geekaholic Jun 11, 2026
a32f203
Merge origin/main (v0.4.4rc1) into resync-dashboard
geekaholic Jun 12, 2026
a3a0cbb
Add proxy-side serving stats backed by ServerMetrics
geekaholic Jun 12, 2026
6a5c632
Populate Active Models panel from backend state in proxy mode
geekaholic Jun 12, 2026
f7c6d47
Repurpose cache panel as backend KV/prefix cache observability in pro…
geekaholic Jun 12, 2026
26ae876
Hide native-only Engine Versions panel in proxy mode
geekaholic Jun 12, 2026
b34c277
Update Linux proxy worklog for dashboard resync
geekaholic Jun 12, 2026
b2814d1
Add Spark handoff brief for dashboard-resync verification
geekaholic Jun 12, 2026
769bcc0
Feed Active Models memory bar from real backend memory in proxy mode
geekaholic Jun 12, 2026
2fd4ba7
Degrade cache panel gracefully on llama.cpp builds without kv_cache_*
geekaholic Jun 12, 2026
37bacf1
Fix three vLLM verification findings from the DGX Spark
geekaholic Jun 12, 2026
dafe959
Clear stale sidecar routing when launching the standalone proxy stack
geekaholic Jun 12, 2026
90c6cd4
Add DGX Spark runbook; record real-backend verification in worklog
geekaholic Jun 12, 2026
e6178c8
Guard injected max_tokens against the backend context window
geekaholic Jun 12, 2026
0394134
Document the max_tokens/context-window misconfiguration and its fix
geekaholic Jun 12, 2026
e43c082
Add opt-in local model scan with one-click sidecar switching
geekaholic Jun 12, 2026
8da6bec
Cap launch context to the model's limit when switching via local scan
geekaholic Jun 12, 2026
5fd903a
Proxy: unified-memory guard, demand-aware vLLM util, HF offline, serv…
geekaholic Jun 14, 2026
febe9f0
Codex: configure via ephemeral CLI overrides instead of mutating conf…
geekaholic Jun 14, 2026
b25b1c6
Enhance chat previews and streaming display
geekaholic Jun 14, 2026
b501b6e
Proxy: stream container logs into the dashboard logs tab
geekaholic Jun 14, 2026
5c1d5fa
Proxy: fix vLLM auto-util starving KV for large models on unified memory
geekaholic Jun 14, 2026
d8a599d
Proxy: Gemma-4 + Codex tool calling, context handling, and settings UX
geekaholic Jun 14, 2026
3cdd25e
Proxy: recover gemma-4 tool calls vLLM leaks into content
geekaholic Jun 14, 2026
5ee7131
Proxy: auto-compute the serving context window per model
geekaholic Jun 15, 2026
e8169f5
Proxy: recover leaked tool calls under char-by-char token streaming
geekaholic Jun 15, 2026
c87021d
Optimize vLLM sidecar context sizing
geekaholic Jun 15, 2026
69f4edf
docs(ui-loop): brainstorm spec + implementation plan
geekaholic Jun 15, 2026
e4fe5d3
test(ui-loop): scaffold ui_loop harness package
geekaholic Jun 15, 2026
17d5129
test(ui-loop): snapshot/restore + heavy-op whitelist guard
geekaholic Jun 15, 2026
8943557
test(ui-loop): live admin client + pure settings diff
geekaholic Jun 15, 2026
cda017e
test(ui-loop): backend metric-family + served-model assertions
geekaholic Jun 15, 2026
51b8563
test(ui-loop): playwright console-error smoke pass
geekaholic Jun 15, 2026
45fe2c6
test(ui-loop): omni-launch-claude e2e probe + env wiring
geekaholic Jun 15, 2026
5a358ab
docs(ui-loop): behavior matrix oracle + tracker
geekaholic Jun 15, 2026
8b99bb1
docs(ui-loop): /loop runner prompt
geekaholic Jun 15, 2026
2e80418
fix(admin): guard owner_hash :href binding with optional chaining
geekaholic Jun 15, 2026
ce398f1
test(ui-loop): phase-1 supervised dry-run validated (3 rows)
geekaholic Jun 15, 2026
c5abca7
test(ui-loop): start Phase 2 (remove STOP gate)
geekaholic Jun 15, 2026
0e85dd8
test(ui-loop): Phase 2 batch 1 — 10 read-only rows pass
geekaholic Jun 15, 2026
1bf6c88
test(ui-loop): flat-key POST contract for settings round-trip
geekaholic Jun 15, 2026
25ae924
test(ui-loop): Phase 2 batch 2 — settings round-trip (8 pass, 3 blocked)
geekaholic Jun 15, 2026
1338e3f
test(ui-loop): Phase 2 batch 3 — vLLM compose-gen + chat render (5 pass)
geekaholic Jun 15, 2026
62cf798
test(ui-loop): Phase 2 batch 4 — inference path (3 pass, launch-claud…
geekaholic Jun 15, 2026
0baa391
test(ui-loop): Phase 2 batch 5 — status/models/logs (4 pass, 1 blocked)
geekaholic Jun 15, 2026
e252eff
test(ui-loop): Phase 2 batch 6 — proxy-mode-inert settings (4 blocked)
geekaholic Jun 15, 2026
68a88f6
test(ui-loop): Phase 2 batch 7 — vLLM model-switch cluster (3 pass)
geekaholic Jun 15, 2026
7ad7d4b
test(ui-loop): Phase 2 batch 8 (finale) — max-tokens guard + router c…
geekaholic Jun 15, 2026
75c1ee0
docs(ui-loop): Phase 2 final report + re-arm STOP
geekaholic Jun 15, 2026
fa6a1c1
docs: document Claude Code small-context max_tokens limitation (won't…
geekaholic Jun 15, 2026
b4f250f
feat(proxy): native Anthropic SSE emitter with tool recovery and vLLM…
geekaholic Jun 16, 2026
29de978
test: stabilize omni auto-util sizing
geekaholic Jun 17, 2026
5293e6d
fix: secure proxy admin surface
geekaholic Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,13 @@ docs/native_app_architecture.md
uv.lock
# generated TurboQuant memory report (machine-specific)
tq_batch_memory.md
# Generated local Docker Compose files
docker/docker-compose.vllm.yml
docker/docker-compose.vllm.env
docker/docker-compose.llamacpp.yml
docker/docker-compose.llamacpp.env
docker/docker-compose.proxy.env
docker/omni-serve.json

# UI QA loop browser-smoke artifacts
docs/qa/artifacts/
61 changes: 61 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What this is

`omlx` is a multi-model LLM/VLM/embedding/reranker inference server for Apple Silicon, built on Apple's MLX (`mlx-lm`, `mlx-vlm`, `mlx-embeddings`). It exposes OpenAI- and Anthropic-compatible HTTP APIs with continuous batching and a tiered (RAM + SSD) KV cache. Apple Silicon only; `requires-python >=3.11`.

## Commands

```bash
# Dev install (extras: mcp, audio, grammar, paroquant, modelscope)
pip install -e ".[dev]"

# Tests — default addopts already excludes `slow` and `integration`
pytest
pytest tests/test_<module>.py -v # single file
pytest -m slow # require model files on disk
pytest -m integration # require a running server
pytest -m turboquant # TurboQuant KV cache suite

# Lint / format / type (line-length 88)
black .
ruff check .
mypy omlx

# Run the server (entry point: omlx.cli:main)
omlx serve --model-dir ~/models
omlx launch <tool> # wire up Claude Code / Codex / Copilot / OpenCode / etc.
omlx diagnose menubar

# Build the native macOS app (venvstacks; first cold build 10–20 min)
apps/omlx-mac/Scripts/build.sh release
```

CI (`.github/workflows/ci.yml`) runs `pytest -m "not slow and not integration"` on macos-14 across Python 3.11–3.14.

## Architecture

Request flow, outermost to innermost:

- **`server.py`** — FastAPI app (~190KB). OpenAI endpoints (`/v1/chat/completions`, `/v1/completions`, `/v1/embeddings`, `/v1/rerank`, `/v1/models`), Anthropic `/v1/messages`, and the `/admin` dashboard.
- **`api/adapters/`** (`openai.py`, `anthropic.py`, `sse_formatter.py`) — translate wire formats to/from the internal `Request`/`RequestOutput` (`request.py`). API model schemas live in `api/*_models.py`.
- **`engine_pool.py`** — multi-model lifecycle: LRU eviction, per-model TTL, pinning, manual load/unload, and routing a request to the right engine type.
- **`engine/`** — `BatchedEngine` (LLM continuous batching), `VLMBatchedEngine`, `EmbeddingEngine`, `RerankerEngine`, `DFlashEngine` (speculative decoding), `STT/TTS/STSEngine` (audio). Shared core is `engine_core.py` (`AsyncEngineCore`, `EngineConfig`).
- **`scheduler.py`** — FCFS request scheduler wrapping mlx-lm's `BatchGenerator`. The largest file in the tree (~320KB); changes here are high-risk.
- **`cache/`** — tiered KV cache (vLLM-inspired): `PagedCacheManager` (GPU, block-based, copy-on-write, prefix sharing) → in-memory hot tier → `PagedSSDCacheManager` (cold SSD tier in safetensors; survives server restart).
- **`process_memory_enforcer.py`** / **`memory_monitor.py`** — total-process memory ceiling (default system RAM − 8GB) to prevent system-wide OOM, plus TTL enforcement.
- **`model_discovery.py`** — auto-detects model type (LLM / VLM / OCR / embedding / reranker) from `--model-dir` subdirectories.
- **`patches/`** — post-load monkey-patches applied to loaded models, both for specific families (`deepseek_v4/`, `step3p7/`, `qwen3_5_attention`, `qwen3_6_nested_visual`, `mlx_lm_mtp/`, `mlx_vlm_mtp/`, `dflash_lifecycle`, `specprefill`) and for upstream mlx-lm/mlx-vlm fixes.

Supporting subsystems: **`admin/`** (vendored offline web UI — chat, benchmark, HF/ModelScope downloader, i18n, per-model settings), **`integrations/`** (one-click client config), **`mcp/`** (Model Context Protocol), **`eval/`** (benchmark datasets), **`oq.py`** (oQ quantization).

## Conventions & gotchas

- **Git-pinned MLX deps.** `mlx-lm`, `mlx-vlm`, `mlx-embeddings`, `dflash-mlx`, and `mlx-audio` are pinned to specific git commits in `pyproject.toml`. `[tool.uv] override-dependencies` forces the resolver past transitive pins (e.g. mlx-audio → `mlx-lm==0.31.1`). When bumping any pinned MLX commit, update the override block too, or resolution breaks.
- **torch is stubbed.** `omlx/_torch_stub.py` lets the default install run without PyTorch; only the `[grammar]`/xgrammar extra pulls real torch. Don't add torch imports on the default code path.
- **Lazy top-level imports.** `omlx/__init__.py` defers public exports via a `_LAZY` map to keep CLI startup fast — add new public names to `_LAZY`, not to module-level imports.
- **License header.** Every source file starts with `# SPDX-License-Identifier: Apache-2.0`.
- **Test naming.** Source `omlx/<module>.py` → test `tests/test_<module>.py`. New code should ship tests; check whether existing tests are affected when editing.
- **Settings.** Persisted to `~/.omlx/settings.json`; CLI flags take precedence over the file. Env vars include `OMLX_MODEL_DIR`, `OMLX_PORT`.
Loading