Run a Local LLM on a CPU With BitNet and a Sprite
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.
Related posts
- Fine-tuning LLMs to 1.58bit: extreme quantization made easy
Hugging Face hardMasterExisting 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. Training uses BitLinear layers with absmean per-tensor weight quantization, absmax per-token 8-bit activation quantization, layer normalization before activation quantization, and a straight-through estimator implemented via detach(). Inference quantizes weights without rescaling and runs matrix multiplication through efficient kernels. The resulting models load in Transformers through a new 'bitnet' quantization method with no API changes, and pre-training experiments show layer normalization lowering validation perplexity from 6.3 to 5.9.
- Deploy Meta Llama 3.1 405B on Google Cloud Vertex AI
Hugging Face mediumAdeptMeta 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. FP16 weights would need ~810 GB, so FP8 (~405 GB) is the recommended way to fit one node while leaving room for KV cache and CUDA graphs. The walkthrough covers the A3 quota requests, gcloud and SDK setup, registering the model with TGI environment variables (MODEL_ID, NUM_SHARD=8, HF token), and deploying to an endpoint, which takes about 25-30 minutes. It then shows how to apply the Llama 3.1 chat template with transformers and send prediction requests to the endpoint from Python.
- A Chatbot on your Laptop: Phi-2 on Intel Meteor Lake
Hugging Face mediumAdeptMicrosoft'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. The walkthrough covers Meteor Lake's CPU, iGPU (Xe Vector Engines with DP4a) and NPU, then shows code using OVWeightQuantizationConfig with bits=4, group_size=128 and ratio=0.8, where 80% of weights go to 4-bit and the rest to 8-bit. Lowering ratio or group size improves accuracy but costs model size and latency. Generation quality and speed are shown only through demo videos, with no measured benchmarks.
- Falcon-Edge: A series of powerful, universal, fine-tunable 1.58bit language models.
Hugging Face hardMasterFalcon-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. A single training run yields three checkpoints: the native BitNet model, a bfloat16 non-BitNet model, and pre-quantized weights for fine-tuning. The bfloat16 variant is produced by quantizing weights to ternary and dividing back by the weight scale, which works because training used fake int8 activation quantization. The accompanying onebitllms package swaps nn.Linear for BitnetLinear and provides Triton kernels so the models can be fully fine-tuned with tools like trl and then re-quantized. PEFT is not yet supported, and BitNet pre-training costs roughly 20% more than standard pre-training.
- Llama 2 is here - get it on Hugging Face
Hugging Face mediumAdeptMeta'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. Inference runs through transformers 4.31 or Text Generation Inference and Inference Endpoints, with recommended GPU sizes per model (A10G for 7B, A100 for 13B, 2-4x A100 for 70B). The 7B model can be fine-tuned on a single 16GB T4 using QLoRA and trl's SFTTrainer. The chat prompt format uses [INST] and <<SYS>> delimiters, and prompts must match the training template exactly for system prompts and multi-turn conversations to work.