JustFit: 200K-Token LLM Serving on a 24 GiB Laptop with Just-in-Time State Management· JustFit:24GB 笔记本上的 20 万_token 大模型服务
Capable open-weight models make local coding and reasoning attractive, but their context and execution state strain laptop memory. We present JustFit, an MLX-based inference runtime that combines KVExec for compressed KV execution, PhaseSwap for component residency, and StateTrans for state-preserving serving transitions. These mechanisms fuse reconstruction and coordinate just-in-time materialization and release, independently of model-weight quantization. In full-execution capacity tests on a 24 GiB M4 Pro MacBook running Qwen3.8-27B MXFP4, three independent runs complete 196,608 input and 16,384 output tokens, increasing completed single-request context from the mlx-vlm baseline's 30,720 positions to 212,992 (6.93x); a separate two-request run retains 229,376 positions in aggregate. In
24GB 笔记本上实现 20 万 token 的大模型服务
- 核心方法
- 提出 JustFit,结合 KVExec、PhaseSwap 和 StateTrans 机制,实现压缩执行、组件驻留和状态保持的动态管理
- 适合谁读
- 研究者 / 工程师
- 要解决的问题
- 大模型在本地运行时,上下文和执行状态占用大量内存,限制了其应用范围
- 关键实验
- 在 24 GiB 内存的 MacBook 上运行 Qwen3.8-27B MXFP4 模型,单请求上下文容量从 30,720 扩展到 212,992,两请求总容量达 229,376
- 主要贡献
- 显著提高了大模型在有限内存设备上的执行效率和上下文容量
- 意义与局限
- 使得大模型在便携设备上的应用成为可能,但可能需要进一步优化以适配更多设备和模型