# rustling

> A Rust local inference engine for the Inkling 2 Mini model on Apple silicon that serves an OpenAI-compatible API for coding agents.

rustling is an open-source inference engine written in Rust that runs Inkling 2 Mini locally on Apple silicon Macs. It serves an OpenAI-compatible API so coding agents such as Codex, aider and opencode can use the local model as they would a hosted one. The repository is published by onatm under Apache-2.0 or MIT terms.

## What It Is

rustling is a command-line tool and Rust library built around a single model family, Inkling 2 Mini, rather than being a general-purpose engine. It is built around Metal on Apple silicon and offers a CPU backend as an alternative. The `rustling` command can chat, generate a single reply, pull models, or serve an HTTP API.

## How the Server Works

`rustling serve` exposes Chat Completions and Responses APIs with streaming and tool calls, plus `/v1/models` and `/health` endpoints. Requests can set temperature, top_p, top_k, seed, max_tokens, stop and reasoning effort, and reasoning is returned separately as `reasoning_content`. Setting `tool_choice` to `none` keeps tools declared while the processed prompt is still reused.

## Model-Specific Optimizations

Because it targets one model family, the engine generates whole tokens in one GPU submission and keeps processed prompts between requests and restarts, in memory and on disk. It can also copy runs of tokens that a reply repeats from the conversation. The default model is Unsloth's UD-Q4_K_M GGUF conversion (16.6 GB), downloaded from the Hugging Face Hub; the published checkpoint and other GGUF files can be selected with `--model`.

## Requirements and Limits

It needs an Apple silicon Mac and a Rust toolchain to build. The README documents memory use of 16.6 GB for the model plus 1 to 5 GB per conversation. The default context window is sized by chip generation. Documented limits: text only (the vision tower is not implemented), one request at a time with others queued, and no CUDA or Vulkan backend.

## Features
- OpenAI-compatible Chat Completions and Responses APIs with streaming and tool calls
- Metal GPU backend for Apple silicon with CPU fallback
- Whole-token generation in a single GPU submission
- Persistent prompt cache across requests and restarts
- Token copying from conversation context
- Interactive chat with a built-in agent and MCP setup
- Per-request sampling and reasoning effort controls
- Automatic model download from Hugging Face Hub
- Chip-based default context window sizing
- Per-request logging of prompt reuse and speed

## Integrations
Codex, aider, opencode, Hugging Face Hub, llama.cpp GGUF formats, MCP

## Platforms
MACOS, CLI, API

## Pricing
Open Source

## Links
- Website: https://github.com/onatm/rustling
- Documentation: https://github.com/onatm/rustling/blob/main/docs/internals.md
- Repository: https://github.com/onatm/rustling
- EveryDev.ai: https://www.everydev.ai/tools/rustling
