---
title: "The Falcon has landed in the Hugging Face ecosystem"
description: "Falcon-7B and Falcon-40B are Apache 2.0 language models from TII, trained mostly on the deduplicated, filtered RefinedWeb dataset."
url: "https://swe.quest/articles/the-falcon-has-landed-in-the-hugging-face-ecosystem-ce9380035627bacb"
canonical: "https://huggingface.co/blog/falcon"
source: "Hugging Face"
published: "2023-06-05"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["llms","inference","model-training","python"]
---

# The Falcon has landed in the Hugging Face ecosystem

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-06-05, 12 min read, How-to. Original: [https://huggingface.co/blog/falcon](https://huggingface.co/blog/falcon)

## Summary

Falcon-7B and Falcon-40B are Apache 2.0 language models from TII, trained mostly on the deduplicated, filtered RefinedWeb dataset. They use multiquery attention, which shrinks the K,V-cache roughly 10-100x (20MB vs 1,100MB for LLaMA-7B at 2,048 context). The walkthrough covers running them with transformers in bfloat16 with remote code, fitting Falcon-40B into about 45GB with 8-bit or about 27GB with 4-bit loading, and serving them via Text Generation Inference. It also covers leaderboard results where the 40B models ranked first and second, and QLoRA fine-tuning with PEFT and TRL's SFTTrainer on a single T4 (7B) or A100 (40B), producing a 65MB adapter.

Written by swe.quest, not by the author.

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

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- transformer language models
- PyTorch basics
- GPU memory and quantization ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))

## Keywords

Falcon-40B, Falcon-7B, RefinedWeb, Text Generation Inference, QLoRA, PEFT, bitsandbytes, multiquery attention

## Related posts

- [Spread Your Wings: Falcon 180B is here](https://swe.quest/articles/spread-your-wings-falcon-180b-is-here-43d1514ef14b323e.md): Hugging Face · 2023-09-06 · Medium · 7 min read · LLMs, Inference & serving, Model training, Python
  Falcon 180B from TII is the largest openly available language model, with 180 billion parameters, trained on 3.5 trillion tokens (mostly RefinedWeb) across up to 4096 GPUs for about 7M GPU hours.
- [Welcome Falcon Mamba: The first strong attention-free 7B model](https://swe.quest/articles/welcome-falcon-mamba-the-first-strong-attention-free-7b-model-207d13ee4cb1b108.md): Hugging Face · 2024-08-12 · Medium · 8 min read · LLMs, Inference & serving, Evaluation, Model training
  Falcon Mamba 7B from TII is a pure Mamba state space language model with extra RMS normalization layers for stable training at scale.
- [Welcome to the Falcon 3 Family of Open Models!](https://swe.quest/articles/welcome-to-the-falcon-3-family-of-open-models-384f88587b978d76.md): Hugging Face · 2024-12-17 · Easy · 6 min read · LLMs, Model training, Evaluation
  Falcon3 is TII's family of open decoder-only LLMs under 10B parameters (1B, 3B, 7B, 10B transformers plus Mamba-7B SSM), focused on math, science and code.
- [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.
- [Making LLMs even more accessible with bitsandbytes, 4-bit quantization and QLoRA](https://swe.quest/articles/making-llms-even-more-accessible-with-bitsandbytes-4-bit-quantization-and-qlora-7bc797d3e83b0ec6.md): Hugging Face · 2023-05-24 · Medium · 14 min read · Inference & serving, Model training, LLMs, Python
  bitsandbytes now integrates 4-bit quantization into Hugging Face transformers, letting most accelerate-loadable models (text, vision, multimodal) run in 4-bit and be fine-tuned via QLoRA, which backpropagates through a frozen 4-bit base model into LoRA adapters.

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)
