# meta-pytorch/gpt-fast

Simple and efficient pytorch-native transformer text generation in <1000 LOC of python.

Repository: https://github.com/meta-pytorch/gpt-fast
Canonical: https://ross.abutalabs.com/products/gpt-fast
Language: Python
License: BSD-3-Clause
License Family: permissive
Last push: 2025-08-22T23:37:14+00:00

## Health v2 (maintenance only)
Score: 44/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 38, release rhythm 35, longevity 75
- inputs: {"age_days": 1051, "days_push": 376, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6249, forks 575 (observed 2026-08-28T04:09:40.966961+00:00)

## What it is
A minimal (<1000 lines) PyTorch-native implementation of fast transformer text generation, demonstrating low-latency LLM inference with int8/int4 quantization, speculative decoding, and tensor parallelism. It is a reference codebase meant to be copied and forked rather than used as a framework, supporting LLaMA-family and Mixtral models on Nvidia and AMD GPUs.

## Use cases
- run llama models fast with pure pytorch
- quantize llm to int8 or int4 for inference
- low latency single-user text generation on gpu
- learn how to optimize transformer inference
- speculative decoding example implementation
- tensor parallel inference across multiple gpus

## When to choose
- you want minimal, hackable, dependency-light LLM inference code in pure PyTorch
- you need very low latency batch-size-1 generation on Nvidia or AMD GPUs
- you want a reference implementation to copy quantization or speculative decoding techniques into your own code

## When to avoid
- you need a production framework with serving APIs, batching, or broad model support
- you want a maintained library with stable APIs - it is explicitly a demo/reference, not a framework
- you need CPU-only inference or non-GPU environments

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, machine-learning, gpu-computing
- domain: large-language-models, deep-learning, machine-learning, performance
- platform: python, cross-platform
- tags: transformer, text-generation, quantization, speculative-decoding, tensor-parallelism, pytorch, llama, mixtral, reference-implementation, gpu, linux

## Member repositories
- meta-pytorch/gpt-fast (main) score 44

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:40.966961+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:47:09.261006+00:00, confidence not recorded.
  - readme: https://github.com/meta-pytorch/gpt-fast (fetched 2026-08-28T04:09:40.966961+00:00, sha 0a442870bad8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
