NEWn1n v2.0.1 is live! Enterprise Unified LLM API Gateway with 500+ AI Models, up to 90% off, Try now

Building Ultra-Fast Local Code Completion Models: The Wisp Family Guide

Authors
  • avatar
    Name
    Nino
    Occupation
    Senior Tech Editor

The landscape of local Large Language Models (LLMs) is rapidly evolving. While massive models like DeepSeek-V3 or Claude 3.5 Sonnet dominate the cloud, a new frontier is emerging in the local developer environment: the ultra-fast, low-latency autocomplete specialist. Most developers today encounter a significant bottleneck when using local models for inline coding suggestions. When a model attempts to handle chat, tool calling, and autocomplete simultaneously, performance degrades. Shrinking these general-purpose models down to the 0.5B-1.5B parameter range leads to three critical failures: markdown fence leaks, poor stopping logic, and high latency that breaks the developer's flow.

Enter The Wisp Family (The Wisp Fieldbook). This series consists of strictly Apache-2.0, non-chat, Fill-in-the-Middle (FIM) specialists. These models are trained, distilled, and quantized on a single Apple Silicon Mac (M5 Max, 128 GiB). By focusing purely on the autocomplete task, the Wisp family achieves sub-30ms latency, providing a seamless "ghost text" experience that rivals or exceeds cloud-based solutions when integrated with platforms like n1n.ai.

The Wisp Family Lineup

The Wisp series is designed to demonstrate that specialized architectural choices can outperform general-purpose scaling.

  1. No. 001 - wisp-coder-110m: A research model utilizing a 108M Llama architecture combined with Multi-Token Prediction (MTP). It serves as a proof of concept for scratch-trained local code models.
  2. No. 002 - Wisp-2-0.8B: A hybrid linear-RNN model (18 GatedDeltaNet + 6 Full Attention layers). It features native EAGLE-3 speculative decoding, hitting 27.5 ms warm keystroke latency on Apple Silicon. This model is certified and available for production use.
  3. No. 003 - Wisp-2.1 (1.5B-Pro & 0.5B-Fast): This dual-sibling pair uses a Pure-FA Qwen2.5-Coder architecture. Distilled directly from the 32B variant of Qwen2.5-Coder, the 1.5B-Pro model has cleared 11 out of 13 certification gates, ensuring zero bitwise parity errors and high-quality roundtrip generation.

Benchmarking the 0.8B Specialist

Performance in code autocomplete isn't just about raw speed; it is about "autonomous stopping." A model that doesn't know when to stop generates unnecessary code, increasing the cognitive load on the developer. In our tests on an M5 Max, Wisp-2-0.8B was compared against stock Qwen2.5-Coder models across 566 code holes in 11 languages.

Model (8-bit MLX)PSM Exact MatchAutonomous Stop %Warm Keystroke p50
Wisp-2-0.8B (EAGLE-3)32.86%97.70%27.49 ms
Qwen2.5-Coder-1.5B24.20%66.61%47.98 ms
Qwen2.5-Coder-0.5B14.66%42.05%72.75 ms

The results show that stock models often slam into the token cap (hitting the limit on up to 58% of tasks), whereas Wisp-2-0.8B stopped cleanly nearly 98% of the time. This reliability is essential for developers who require a stable API experience, much like the high-speed endpoints aggregated by n1n.ai.

Engineering Lesson 1: Precision and Quantization

One of the most surprising findings during the development of Wisp-2 was that 8-bit quantization can actually be faster and more accurate than FP16 if handled correctly. During a 1,000-round parity audit, standard 8-bit quantization caused subtle token flips due to rounding errors. By promoting only the quantization scales and recurrence states to FP32 while keeping weights in 8-bit, we eliminated all drift.

Furthermore, zero-step Post-Training Quantization (PTQ) often outperformed Quantization-Aware Training (QAT). This suggests that for sub-2B models, the damage from quantization is often non-existent if the weights are well-regularized, and attempting to "heal" the model via QAT can actually introduce new errors if the loss functions are not perfectly anchored.

Engineering Lesson 2: Mastering Speculative Decoding

Speculative decoding is the secret sauce for achieving sub-30ms latency. The Wisp-2.1 uses EAGLE-3, but implementing it on Qwen2.5-Coder architectures required overcoming "activation-sink" issues. Qwen models often have extreme activation values that get crushed after the final RMSNorm. To solve this, we implemented:

  • Pre-final-norm 3-tap fusion: Integrating features from multiple layers (L2, L13, L27) before the final normalization.
  • Global Best-Fit Decreasing block packing: Ensuring 99.84% occupancy in the compute blocks to maximize Apple Silicon's unified memory bandwidth.

This approach ensures that the "drafter" model accurately predicts the next tokens, which the "verifier" model then confirms in a single pass. For developers using n1n.ai, this architectural efficiency translates to local performance that feels as snappy as top-tier cloud APIs.

Implementation: Running Wisp Locally

You can deploy a local, OpenAI-compatible autocomplete server using the wisp_runtime package. This allows you to integrate Wisp directly into editors like Zed or VS Code (via Continue.dev).

# Install dependencies
pip install -r requirements.txt

# Start the local FIM (Fill-in-the-Middle) server
# Default port 8091, optimized for sub-30ms response
python -m wisp_runtime.serve --bundle-dir ./Wisp-2-0.8B-MLX-8bit --host 127.0.0.1 --port 8091

Once the server is running, you can configure your IDE to point to http://127.0.0.1:8091/v1/fim/completions. This setup provides a private, offline, and incredibly fast coding assistant.

Why Sub-2B Models Matter

While the industry focuses on trillion-parameter models, the Wisp project proves that specialized sub-2B models are the key to the "reflexive" layer of AI. A model that responds in < 30ms changes the psychology of coding; it becomes an extension of your thought process rather than a tool you wait for. By combining local specialists like Wisp with the broad reasoning capabilities of models available through n1n.ai, developers can build a hybrid workflow that is both powerful and low-latency.

Get a free API key at n1n.ai