{"id":51118678,"url":"https://github.com/defilantech/mlx-server","last_synced_at":"2026-06-25T00:01:16.062Z","repository":{"id":358106692,"uuid":"1236240454","full_name":"defilantech/mlx-server","owner":"defilantech","description":"OpenAI-compatible HTTP server for mlx-swift-lm on Apple Silicon. Drop-in replacement for llama-server with state-of-the-art speculative decoding.","archived":false,"fork":false,"pushed_at":"2026-05-17T19:03:39.000Z","size":40,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-17T19:38:17.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defilantech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T04:27:54.000Z","updated_at":"2026-05-17T18:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/defilantech/mlx-server","commit_stats":null,"previous_names":["defilan/mlx-server","defilantech/mlx-server"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/defilantech/mlx-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defilantech%2Fmlx-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defilantech%2Fmlx-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defilantech%2Fmlx-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defilantech%2Fmlx-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defilantech","download_url":"https://codeload.github.com/defilantech/mlx-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defilantech%2Fmlx-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34753781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-25T00:01:15.240Z","updated_at":"2026-06-25T00:01:16.045Z","avatar_url":"https://github.com/defilantech.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mlx-server\n\nOpenAI-compatible HTTP server for [mlx-swift-lm](https://github.com/ekryski/mlx-swift-lm) on Apple Silicon.\n\n## Status\n\n**Phase 1 + tool calling: working.** Loads an MLX model and serves\n`/v1/chat/completions` (streaming and non-streaming), `/v1/models`, and\n`/health`, with OpenAI-compatible tool calling. Validated end-to-end against\nQwen3-4B and Qwen3.6-35B-A3B (MoE). See the [roadmap](#roadmap) for what is next.\n\n## Why this exists\n\n[mlx-swift-lm](https://github.com/ekryski/mlx-swift-lm) is a high-performance LLM inference library for Apple Silicon, with state-of-the-art speculative decoding, prefix KV-cache, and hybrid-architecture state replay landing in its [Tier 1 roadmap](https://github.com/ekryski/mlx-swift-lm/blob/alpha/specs/IMPLEMENTATION-PLAN.md). It is, by design, a Swift library, not a server. `mlx-server` is the missing HTTP layer.\n\nThe end goal is to be a drop-in replacement for `llama-server` in [LLMKube](https://llmkube.com)'s Apple Silicon path, with the perf characteristics of mlx-swift-lm.\n\n## Goals\n\n- OpenAI-compatible API surface: `/v1/chat/completions`, `/v1/completions`, `/v1/models`, `/v1/embeddings`\n- Streaming via Server-Sent Events\n- Tool calling and structured outputs\n- Vision-language model support (Qwen-VL, Gemma 4 VL, etc.)\n- Multi-slot concurrency with longest-prefix KV cache reuse\n- One-command install via Homebrew, plus prebuilt GitHub releases\n\n## Non-goals\n\n- Cross-platform support. Apple Silicon (arm64 macOS) only. If you need x86_64 or Linux, look at [llama.cpp](https://github.com/ggerganov/llama.cpp).\n- vLLM compatibility. For that path see [vllm-swift](https://github.com/TheTom/vllm-swift) (Python API + Swift compute) or [vllm-metal](https://github.com/vllm-project/vllm-metal).\n- Heavy abstractions over mlx-swift-lm. This is a thin HTTP wrapper, not a framework.\n\n## Prior art\n\n[TheTom's MLXServer](https://github.com/ekryski/mlx-swift-lm/tree/ek/tom-eric-moe-tuning/Sources/MLXServer) (abandoned in favor of vllm-swift) was the proof-of-concept that an MLX-swift HTTP server is feasible. Several design decisions here, particularly around the slot manager and longest-prefix KV cache, are informed by his approach. The decision to rebuild rather than fork is mainly because his original used hand-rolled socket code; this repo uses [Hummingbird](https://github.com/hummingbird-project/hummingbird) for the HTTP layer.\n\n## Install\n\n```bash\nbrew install defilantech/tap/mlx-server\n```\n\nApple Silicon, macOS 14 (Sonoma) or later. This installs the latest prebuilt\nrelease; older versions and the raw tarballs are on the\n[releases page](https://github.com/defilantech/mlx-server/releases). Then:\n\n```bash\nmlx-server --model /path/to/mlx-model-dir --port 8080\n```\n\n## Build from source\n\nRequires:\n- macOS 14 (Sonoma) or later, Apple Silicon\n- Swift 6.0 or later (Xcode 16+)\n\n`swift build` compiles the project (and is what CI runs), but **SwiftPM cannot\ncompile mlx-swift's Metal shaders** — a binary built that way fails at runtime\nwith `Failed to load the default metallib`. To run the server, build with\n`xcodebuild`, which compiles and bundles the Metal library next to the binary:\n\n```bash\nxcodebuild -scheme mlx-server -destination 'platform=macOS,arch=arm64' \\\n  -configuration Debug -derivedDataPath .build/xcode -skipMacroValidation build\n\n.build/xcode/Build/Products/Debug/mlx-server \\\n  --model /path/to/mlx-model-dir --port 8080\n```\n\n`--model` takes a local MLX model directory or a HuggingFace id. Other flags:\n\n- `--host`, `--port`, `--max-slots`\n- `--tool-call-format` — e.g. `xml_function` for Qwen3.5 / Qwen3-Coder;\n  auto-inferred when unset\n- `--reasoning` — how thinking output is split into `reasoning_content` vs\n  `content`: `auto` (default; splits on a literal `\u003cthink\u003e`/`\u003c/think\u003e`),\n  `prefilled` (output starts mid-thought — use for Qwen3.5 / Qwen3.6), or\n  `off`\n\n## Roadmap\n\n| Phase | Scope | Status |\n|-------|-------|--------|\n| 0 | Scaffolding, CI, `/health` endpoint, dependency wiring | Done |\n| 1 | `/v1/chat/completions` (streaming + non-streaming), `/v1/models`, single-slot model loading | Done |\n| 2 | Multi-slot `SlotManager`, longest-prefix prompt cache, Prometheus `/metrics`, structured logging, graceful shutdown | |\n| 3 | Tool calling, thinking-model support, vision-language models, speculative decoding knobs, `/v1/embeddings` | Tool calling done |\n| 4 | LLMKube `runtime: mlx-server` integration | |\n\n## License\n\nApache 2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefilantech%2Fmlx-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefilantech%2Fmlx-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefilantech%2Fmlx-server/lists"}