openai-compatible text inference with continuous batching
Exposes a FastAPI server implementing OpenAI's /v1/completions and /v1/chat/completions endpoints, backed by a vLLM-style continuous batching scheduler that dynamically groups requests into batches and executes them on Apple Silicon MLX kernels. The scheduler maintains a request queue, allocates KV cache pages on-demand, and interleaves token generation across multiple requests to maximize GPU utilization without blocking on individual request completion.
Unique: Implements vLLM's continuous batching scheduler (dynamic request grouping without blocking) on Apple Silicon's unified memory architecture, enabling efficient multi-request handling without the overhead of cloud API calls or the latency of sequential processing
vs alternatives: Faster than Ollama for concurrent requests due to continuous batching; more memory-efficient than running separate model instances; compatible with existing OpenAI client libraries without code changes
anthropic-compatible messages api with tool calling
Implements Anthropic's /v1/messages endpoint with native support for tool_use blocks, allowing models to request external tool execution via structured JSON schemas. The server parses tool definitions, validates model-generated tool calls against the schema, and integrates with the Model Context Protocol (MCP) to execute tools and return results back to the model in a multi-turn conversation loop.
Unique: Bridges Anthropic's tool-calling API with MLX-based models and MCP protocol, enabling local models to execute external tools with the same interface as Claude while maintaining full conversation context and multi-turn tool use patterns
vs alternatives: More flexible than vLLM's function calling (supports arbitrary tool schemas); more portable than Anthropic's API (runs locally); better tool execution isolation than naive prompt-based tool calling
server configuration and model loading with auto-quantization
Provides CLI and programmatic configuration for server startup, model selection, and quantization strategy. Automatically detects available GPU memory, selects appropriate quantization (4-bit, 8-bit, or full precision) based on model size and available memory, and loads models into MLX with optimized memory layout. Supports model discovery from HuggingFace Hub with automatic format conversion.
Unique: Automatically selects quantization strategy based on GPU memory detection and model size, eliminating manual tuning; integrates HuggingFace Hub discovery with MLX format conversion for seamless model loading
vs alternatives: More automated than manual quantization; faster model loading than format conversion scripts; better memory utilization than fixed quantization strategies
streaming response collection with server-sent events
Implements Server-Sent Events (SSE) streaming for all generation endpoints, allowing clients to receive tokens as they are generated without waiting for completion. The server maintains per-request token buffers, flushes tokens at configurable intervals, and handles client disconnections gracefully. Supports both text and multimodal streaming with consistent message formatting.
Unique: Implements SSE streaming with per-request token buffering and configurable flush intervals, enabling real-time token delivery while minimizing network overhead; handles client disconnections gracefully without blocking generation
vs alternatives: More efficient than polling for token updates; simpler than WebSocket for one-way streaming; compatible with standard HTTP clients
error recovery and resilience with request retry logic
Implements automatic error recovery for transient failures (OOM, timeout, model errors) with exponential backoff retry logic. Failed requests are queued for retry with configurable retry counts and backoff strategies. The scheduler tracks request state and can resume interrupted generations from checkpoints, reducing wasted computation.
Unique: Implements exponential backoff retry logic with checkpoint-based recovery, enabling automatic recovery from transient failures without user intervention; tracks request state to resume interrupted generations
vs alternatives: More sophisticated than simple retry (exponential backoff prevents thundering herd); checkpoint-based recovery reduces wasted computation vs full regeneration; automatic classification of retryable errors
performance monitoring and benchmarking with metrics collection
Collects detailed performance metrics including tokens-per-second throughput, latency percentiles (p50/p95/p99), GPU memory utilization, and cache hit rates. Exposes metrics via Prometheus-compatible endpoint and provides CLI benchmarking tools for model comparison. Tracks per-request metrics and aggregates them for system-wide analysis.
Unique: Collects fine-grained per-request metrics (latency, throughput, cache hits) and aggregates them for system-wide analysis; provides both Prometheus export and CLI benchmarking tools for comprehensive performance visibility
vs alternatives: More detailed than basic logging (per-request metrics); Prometheus-compatible for integration with existing monitoring stacks; built-in benchmarking tools vs external profilers
multimodal inference with vision and video understanding
Processes images and video frames through vision-language models (LLaVA, Qwen-VL) by encoding visual inputs into MLX tensors, caching vision embeddings to avoid redundant computation, and fusing visual tokens with text tokens in the model's input sequence. Supports batch processing of multiple images per request and video frame extraction with configurable sampling strategies to balance quality and latency.
Unique: Implements paged KV cache for vision embeddings (caching vision encoder outputs across requests), reducing redundant computation when the same image is referenced multiple times; integrates video frame extraction with configurable sampling to balance quality and latency on Apple Silicon
vs alternatives: More efficient than re-encoding images on every request (vision cache); faster than cloud vision APIs for local processing; supports video understanding unlike most local vision models
speech-to-text transcription with streaming audio input
Accepts audio streams or files, processes them through MLX-based speech recognition models (Whisper or similar), and returns transcriptions with optional timestamp alignment. Supports streaming input via chunked audio frames, allowing real-time transcription as audio arrives without waiting for the full file.
Unique: Streams audio input through MLX-based Whisper models with frame-level processing, enabling real-time transcription without buffering entire audio files; integrates with continuous batching to handle multiple concurrent audio streams
vs alternatives: Lower latency than cloud STT APIs for local processing; supports streaming input unlike batch-only local models; maintains privacy by processing audio on-device
+6 more capabilities