---
title: "Run a Local LLM on a CPU With BitNet and a Sprite"
description: "Microsoft's BitNet b1.58-2B-4T, a 1.58-bit ternary-weight model, runs on a Fly.io Sprite's CPU in about 1.3GB of RAM at roughly 50 tokens/sec with ~1.4s end-to-end latency."
url: "https://swe.quest/articles/run-a-local-llm-on-a-cpu-with-bitnet-and-a-sprite-4eecc23efef4077b"
canonical: "https://fly.io/blog/local-llm-on-a-sprite/"
source: "Fly.io"
published: "2026-03-16"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["inference","llms","serverless"]
---

# Run a Local LLM on a CPU With BitNet and a Sprite

A post on [Fly.io](https://swe.quest/sources/flyio.md), published 2026-03-16, 5 min read, How-to. Original: [https://fly.io/blog/local-llm-on-a-sprite/](https://fly.io/blog/local-llm-on-a-sprite/)

## Summary

Microsoft's BitNet b1.58-2B-4T, a 1.58-bit ternary-weight model, runs on a Fly.io Sprite's CPU in about 1.3GB of RAM at roughly 50 tokens/sec with ~1.4s end-to-end latency. A ~200-line stdlib Python server wraps llama-cli to expose an OpenAI-compatible endpoint, a chat UI and a self-serving client file, giving other Sprites a shared, scale-to-zero inference service. Checkpoints capture weights, compiled kernels and code together, so trying new models, chat templates or llama.cpp builds can be rolled back in one step. Build notes include pinning sentencepiece 0.2.1, fixing a const-correctness bug in ggml-bitnet-mad.cpp and downloading the pre-quantized GGUF. The suggested pattern is to use the small model for cheap classification and routing and fall back to a frontier model for real reasoning.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)

## Prerequisites

- LLM quantization basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- llama.cpp
- Python HTTP servers ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

BitNet, Fly.io Sprites, llama.cpp, GGUF, OpenAI-compatible API, Claude

## Related posts

- [Fine-tuning LLMs to 1.58bit: extreme quantization made easy](https://swe.quest/articles/fine-tuning-llms-to-1-58bit-extreme-quantization-made-easy-1f532a3df4c4d82f.md): Hugging Face · 2024-09-18 · Hard · 28 min read · Inference & serving, Model training, LLMs
  Existing LLMs can be fine-tuned into BitNet's 1.58-bit ternary format (-1, 0, 1) instead of pre-training from scratch, and a Llama3 8B fine-tuned this way on 100B tokens outperforms Llama 1 7B on MMLU.
- [Deploy Meta Llama 3.1 405B on Google Cloud Vertex AI](https://swe.quest/articles/deploy-meta-llama-3-1-405b-on-google-cloud-vertex-ai-013efe3f83445849.md): Hugging Face · 2024-08-19 · Medium · 12 min read · Inference & serving, LLMs, Cloud platforms
  Meta Llama 3.1 405B Instruct in FP8 can be served on a single Google Cloud A3 node (8x H100 80GB, ~640 GB VRAM) through Vertex AI, using Hugging Face's Text Generation Inference Deep Learning Container.
- [A Chatbot on your Laptop: Phi-2 on Intel Meteor Lake](https://swe.quest/articles/a-chatbot-on-your-laptop-phi-2-on-intel-meteor-lake-3ad1272519c8d71d.md): Hugging Face · 2024-03-20 · Medium · 7 min read · Inference & serving, LLMs, Hardware, Python
  Microsoft's 2.7B-parameter Phi-2 can run as a usable local chatbot on a mid-range Intel Core Ultra 7 155H (Meteor Lake) laptop once its weights are quantized to 4-bit with OpenVINO through Hugging Face's Optimum Intel library.
- [Falcon-Edge: A series of powerful, universal, fine-tunable 1.58bit language models.](https://swe.quest/articles/falcon-edge-a-series-of-powerful-universal-fine-tunable-1-58bit-language-models-3708dd89aa2b35cd.md): Hugging Face · 2025-05-15 · Hard · 9 min read · Model training, LLMs, Inference & serving, Python
  Falcon-Edge is a set of 1B and 3B ternary (1.58-bit) BitNet language models, in base and instruct variants, pre-trained on about 1.5T tokens with a WSD learning-rate schedule and reported competitive with similarly sized models on Hugging Face leaderboard benchmarks.
- [Llama 2 is here - get it on Hugging Face](https://swe.quest/articles/llama-2-is-here-get-it-on-hugging-face-c56eec059476bd0f.md): Hugging Face · 2023-07-18 · Medium · 9 min read · LLMs, Inference & serving, Model training, Python
  Meta's Llama 2 family (7B, 13B, 70B base and RLHF-tuned chat models) is released under a commercially usable license, trained on 40% more tokens than Llama 1 with 4k context and grouped-query attention for the 70B model, and is integrated across the Hugging Face ecosystem.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
