Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

jasontitus/loopedqwen

Machine LearningModel serving

Recurrent-loop adapter and serving plugins that make Qwen3.8-27B reason in fewer visible tokens on Mac and CUDA GPUs.

131
18
Python
MIT
7 days old

What It Is

Looped Qwen3.8-27B modifies the open Qwen3.8-27B model so its middle layers are run repeatedly before output, rather than letting the model emit a long visible chain of thought. The recurring component is a 240 MB gated workspace adapter (about 62.85M parameters) that loops layers 24–39, with optional LoopCD-Hidden and calibrated BF16 MTP speculative decoding. The project ships two serving paths: an mlx-serve plugin for Apple Silicon and a vLLM plugin for NVIDIA GPUs, plus a pure-Python mlx-lm runner and training scripts. The adapter weights live separately on Hugging Face.

The stated goal is fewer <think> tokens at similar answer quality, mainly for people running a 27B model locally or on a rented GPU. The README reports 52–71% reasoning-token compression and shows a low-memory table spanning 8-bit, 4-bit, and 1.76-bit Bonsai quantization. Those figures are the author's measurements on a single M2 Max (plus some M4 Pro validation), not independently verified here.

Quick Start

Apple Silicon (24 GB+ RAM). The fastest path is the one-line installer, which sets up mlx-serve and opens a local chat UI at http://127.0.0.1:11234:

curl -fsSL https://raw.githubusercontent.com/jasontitus/loopedqwen/main/install_mac.sh | bash

Alternatively, download the Mac disk image from the latest release and open Install Looped Qwen3.8.command from it (installer lines). The installer reuses an existing mlx-serve model download when one is present.

Point a client at it. For Claude Code on Mac, run mlx-serve launch claude. For Cursor, Cline, OpenWebUI, or another OpenAI-compatible app, set base URL http://127.0.0.1:11234/v1, API key local, and model Looped-Qwen3.8-27B (client settings).

NVIDIA GPUs (48 GB+). On a Linux box or cloud pod, the one-line installer selects FP8 on 48 GB cards or BF16 on 80 GB+:

curl -fsSL https://raw.githubusercontent.com/jasontitus/loopedqwen/main/install_cuda.sh | bash

The vLLM path can also be installed manually: install the plugin from the repository's vllm_looped_qwen38 subdirectory, then serve Qwen/Qwen3.8-27B with the LoopedQwen3_5ForCausalLM architecture override and --max-model-len 81920 (vLLM instructions).

Pure Python on Mac. install_mac.sh --python creates an isolated virtual environment; from a clone you can instead run pip install -r requirements.txt and python3 scripts/run_mlx.py --prompt "..." (MLX runner).

Architecture tests without the 27B download. Build the Zig plugin with ./plugins/looped_qwen38/build_from_source.sh and run the offline invariant suites described in the README.

Constraints

  • Hardware: Apple Silicon Macs are listed at 24 GB+ RAM; low-bit Bonsai runs are reported around 12–13 GB peak, while 8-bit needs roughly 33–37 GB. CUDA needs a 48 GB+ NVIDIA GPU and currently TP=1.
  • Serving stack: The MLX route depends on mlx-serve (the plugin targets v26.11.4+); the CUDA route depends on a working vLLM install. The Bonsai 1.76-bit support requires the plugin's own weight format, not just a standard Qwen checkpoint.
  • Adapters and weights: The base model and adapter are downloaded from third-party hosts; the plugin auto-downloads the v3.1 adapter on first launch, so offline use needs a pre-populated cache.
  • Benchmark caveats: Results come from small task sets (e.g., 18 or 30 items), one Mac configuration, and author-run evaluations; differences of a few points are within likely noise. Treat the tables as the author's experiments to reproduce, not settled model quality.
  • License: Code is MIT. The base Qwen weights and adapter carry their own model terms on Hugging Face.

HotRepo's take

The repository does have concrete engineering to inspect: loop wrappers, an MTP speculative decoder, Zig plugin sources, vLLM integration, and training scripts, rather than a README-only shell. Its HotRepo record is thin: a single new-board entry on 2026-11-30 (Python, 107 stars, 16 forks), with the collected curve showing stars moving from 102 to 107 within about 90 minutes that afternoon. There is no all-language daily rank and no discussion thread to draw on. Given the large performance claims and the installation path that pipes a remote script into bash or ships a .dmg, the useful next check for readers is whether the published weights and plugin versions reproduce the stated token reductions on their own hardware.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. open-agent-infra/RSInferAn OpenAI-compatible LLM serving engine that hot-reloads schedulers, kernels and models on live GPUs without restarts.Python104
  2. Vitolearns/KVHarborA C++20 single-GPU LLM serving layer with HTTP/SSE admission control, streaming, and optional speech endpoints.Python107
  3. eagle-hq/EAGLE-4Speculative decoding drafter and harness that speeds up LLM serving in SGLang, vLLM and TokenSpeed across batch sizes and GPUs.Python967
  4. vllm-project/vllm-ascendHardware plugin that runs vLLM inference on Huawei Ascend NPUs for serving LLMs and multimodal models.Python3,105
  5. FlashML-org/FreeTokenServes frontier-scale MoE models on consumer GPUs and CPUs by pooling VRAM, RAM, and compute for local inference.Python15,073