---
title: "Tricks from OpenAI gpt-oss YOU 🫵 can use with transformers"
description: "Hugging Face upgraded transformers to support OpenAI's gpt-oss models, and most of the new features carry over to other models."
url: "https://swe.quest/articles/tricks-from-openai-gpt-oss-you-can-use-with-transformers-aad70bf42c0bd3ff"
canonical: "https://huggingface.co/blog/faster-transformers"
source: "Hugging Face"
published: "2025-09-11"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 15
tags: ["inference","llms","python","performance"]
---

# Tricks from OpenAI gpt-oss YOU 🫵 can use with transformers

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-09-11, 15 min read, Deep dive. Original: [https://huggingface.co/blog/faster-transformers](https://huggingface.co/blog/faster-transformers)

## Summary

Hugging Face upgraded transformers to support OpenAI's gpt-oss models, and most of the new features carry over to other models. These include pre-built kernels downloaded from the Hub (Liger RMSNorm, MegaBlocks MoE, Flash Attention 3 with attention sinks), native MXFP4 4-bit quantization via Triton kernels, tensor and expert parallelism, dynamic sliding window caching, continuous batching with paged attention, and faster loading. MXFP4 stores E2M1 values in 32-element blocks with shared scales. That lets gpt-oss-20B run in about 16 GB of VRAM and 120B in about 80 GB, versus roughly 4× the memory in the bf16 fallback. Benchmarks show the custom and MXFP4 kernels pay off mainly at larger batch sizes.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- PyTorch basics
- transformer architecture ([easy posts on System design](https://swe.quest/tags/system-design.md?difficulty=easy))
- Mixture of Experts models
- GPU inference concepts ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))

## Keywords

transformers, gpt-oss, MXFP4, Flash Attention 3, Triton, MegaBlocks, tensor parallelism, expert parallelism

## Related posts

- [Welcome GPT OSS, the new open-source model family from OpenAI!](https://swe.quest/articles/welcome-gpt-oss-the-new-open-source-model-family-from-openai-490c13c2b6a8b9fc.md): Hugging Face · 2025-08-05 · Medium · 25 min read · LLMs, Inference & serving, Open source, Python
  OpenAI's gpt-oss-120b (117B total, 5.1B active) and gpt-oss-20b (21B total, 3.6B active) are Apache 2.0 open-weight mixture-of-experts reasoning models.
- [Transformers now runs llama.cpp quants](https://swe.quest/articles/transformers-now-runs-llama-cpp-quants-cff2353854049dc6.md): Hugging Face · 2026-09-22 · Medium · 11 min read · Inference & serving, LLMs, Python, Performance engineering
  Hugging Face transformers can now load GGUF (llama.cpp) quantized checkpoints via \`from\_pretrained(..., gguf\_file=...)\` and serve them through \`transformers serve\` with an OpenAI-compatible API.
- [Native-speed vLLM transformers modeling backend](https://swe.quest/articles/native-speed-vllm-transformers-modeling-backend-cb3f698fe9046ce3.md): Hugging Face · 2026-07-08 · Hard · 5 min read · Inference & serving, LLMs, Performance engineering, Python
  The transformers modeling backend in vLLM now matches or beats vLLM's hand-written native implementations in throughput.
- [180B Parameters, 32GB of RAM: Pushing MoE Inference to the Limit with Transformers](https://swe.quest/articles/180b-parameters-32gb-of-ram-pushing-moe-inference-to-the-limit-with-transformers-63cd3cf21432f7c3.md): Hugging Face · 2026-11-18 · Hard · 11 min read · Inference & serving, LLMs, Performance engineering, Caching, Hardware
  Streaming MoE experts from SSD through a bounded device-side slot pool lets Transformers run Qwen3.8-Flash-Next (121 GB of experts) on a 32 GB MacBook M5 at ~13.9 tok/s, within 6% of the specialized Strata engine on decode and slightly faster on prefill.
- [Making LLMs lighter with AutoGPTQ and transformers](https://swe.quest/articles/making-llms-lighter-with-autogptq-and-transformers-6a1ce27ee3288303.md): Hugging Face · 2023-08-23 · Medium · 10 min read · Inference & serving, LLMs, Performance engineering, Hardware
  AutoGPTQ is now integrated into Hugging Face Transformers (via Optimum), letting users quantize and run LLMs at 8, 4, 3 or 2 bits with the GPTQ post-training method.

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)
