Model or dataset
metainternal/llama-cookbook avatar
metainternal/llama-cookbook

Llama Cookbook: Meta's Notebook Guide to Inference, Fine-Tuning, and RAG

Welcome to the Llama Cookbook! This is your go to guide for Building with Llama: Getting started with Inference, Fine-Tuning, RAG. We also show you how to solve end to end problems using Llama model family and using them on various provider services

18,560 stars2,760 forksJupyter NotebookMIT

At a glance

What is it?
Meta's llama-cookbook is a collection of Jupyter notebooks and recipes for building with the Llama model family. It covers inference, fine-tuning, RAG, and end-to-end use cases, but its recent refactor and API-centric focus require careful navigation.
Who is it for?
Adopt llama-cookbook if you are a developer or researcher who wants copy-paste notebook examples for Llama inference, fine-tuning, or RAG, especially if you plan to use the hosted Llama API or third-party providers. Skip it if you need a maintained library with stable APIs, because the repo is primarily a set of examples that change with each model release.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 119 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What llama-cookbook actually is

The repository is Meta's official collection of Jupyter notebooks and guides for building with the Llama model family. It is not a software library in the traditional sense. It is a set of recipes that walk you through inference, fine-tuning, and retrieval-augmented generation, plus end-to-end use cases that span domains like WhatsApp bots, research paper analysis, and character mind maps. The README is explicit: it is the official guide to building with Llama. The primary audience is developers who want practical, runnable examples rather than reading API documentation. If you are evaluating it for adoption, understand that you are adopting a set of examples, not a framework. The repo was renamed from llama-recipes to llama-cookbook, which signals a shift from a package-like structure to a cookbook approach.

The refactor and the archive-main branch

The README notes a recent refactor of the repository. It points to an archive-main branch as a snapshot from before the refactor, and it answers FAQ questions about broken links by directing users to that branch. This is a significant maintenance signal. The refactor means that any external references to the old llama-recipes structure may break. The repository's default branch has changed its layout, and the archive branch preserves the old state. For anyone who relied on llama-recipes as a library, this is a breaking change. The README does not detail what changed beyond the rename and restructuring, so you cannot assume backward compatibility. If you find a notebook from an older tutorial that references llama-recipes, you may need to use the archive branch to get the matching code.

What the repository structure tells you

The repository has four main directories: 3p-integrations, end-to-end-use-cases, getting-started, and src. The 3p-integrations folder contains recipes from various Llama providers, meaning you can see how to use Llama models on services like vLLM or LangChain, based on the topics listed. The getting-started folder is the core reference for inference, fine-tuning, and RAG examples. The end-to-end-use-cases folder shows complete applications, which is where you see the WhatsApp bot and research paper analyzer examples. The src folder contains the original llama-recipes library source and fine-tuning FAQs. This structure suggests that the repository is organized by learning path rather than by model version. That is useful for browsing, but it also means that recipes for different Llama versions coexist, so you must check which model each notebook targets.

Getting started: inference and the Llama API

The README highlights a notebook called build_with_llama_api.ipynb under getting-started, which is the entry point for using the Llama API. There is also a notebook for Llama 4 Scout that demonstrates a 5M long context, and one for Llama 4 Maverick for research paper analysis. To get started, you would open these notebooks in a Jupyter environment. The README links to the Llama API waitlist and documentation, so the first step is to obtain API access. The inference examples likely show how to send prompts to the hosted API and receive completions. There is no command-line installation step for the entire repository; instead, each notebook likely installs its own dependencies as needed. This is typical for cookbook-style repos. For engineers, this means you are not installing a package called llama-cookbook; you are running notebooks that may require specific Python packages like langchain or vllm, as indicated by the repository's topics.

Fine-tuning and the legacy src folder

Fine-tuning is a major focus. The getting-started/finetuning directory contains recipes, and the src folder holds the source for the original llama-recipes library along with fine-tuning FAQs. The src folder is a remnant of the library era. The README points to a Fine-Tuning FAQ in src/docs for questions. This suggests that the fine-tuning examples may rely on code from the src folder, which is not a published package but a local source tree. If you want to run fine-tuning, you may need to import from that local src directory. This is a maintenance burden because the src code may not be versioned with the notebooks. The release tags show v0.0.5 and earlier versions under the name llama-recipes, which indicates that the last packaged release was in January 2025. After the rename, there may not be a new package release, so you are dependent on the repository's current state.

End-to-end use cases and provider integrations

The repository is not just about getting started. It includes end-to-end use cases that solve concrete problems. The README lists examples: a WhatsApp bot integrated with Llama API, a research paper analyzer using Llama 4 Maverick, and a book character mind map generator. These are complete applications, not just model calls. The 3p-integrations folder adds recipes from various providers, which is useful if you want to run Llama models on a specific service like vLLM or LangChain. The presence of these folders shows that the cookbook aims to cover the full journey from a single inference call to a deployed application. However, the README does not provide details on how these use cases are deployed. You must open each notebook or README within those folders to see the actual steps. The value here is in seeing how to combine Llama with external tools, but the trade-off is that each use case may have its own dependencies and setup, making it less portable.

Licensing and model-specific terms

The repository itself is licensed under MIT, as shown in the repository metadata. However, the README is careful to link to separate license files for each Llama model version, from Llama 2 through Llama 4. This is a critical distinction. The code in the cookbook is MIT-licensed, but the models you use with it are not. Each model has its own license and acceptable use policy. When you adopt llama-cookbook, you are not getting a license to use Llama models. You must review the specific license for the model you intend to use, such as the Llama 4 license or the Llama 3.3 license, and comply with its terms. The README also links to an Acceptable Use Policy for each model. For an engineering team, this means legal review is required before using any recipe with a production model. The MIT license on the notebooks is permissive, but it does not extend to the model weights or the hosted API usage.

Limitations and when it is the wrong tool

The most obvious limitation is that this is a notebook collection, not a maintained library. The refactor broke links, and the archive branch is a stopgap. The README itself admits that links may be broken. If you need a stable API for fine-tuning or inference in a production pipeline, this repository is the wrong tool. The source code in src is not packaged, and the last release was for llama-recipes, not llama-cookbook. Another limitation is that the recipes are model-specific. A notebook for Llama 4 Scout may not work with Llama 3.1 without changes. The README emphasizes the latest Llama 4 recipes, but it also covers older models, so you must match the notebook to your model. Finally, the reliance on the hosted Llama API for many examples means you need to join a waitlist and obtain access, which may not be available in all regions or for all users. If you want to run models fully on-premises, you will need to adapt the examples to use local inference engines.

Alternatives and what to verify first

A real alternative is the Hugging Face transformers library, which supports Llama models through the meta-llama organization on Hugging Face. The difference is that transformers provides a unified API for model loading and fine-tuning, whereas llama-cookbook gives you notebook examples that may use various frameworks. Another alternative is vLLM for inference, which is listed as a topic and appears in the 3p-integrations. vLLM offers a high-performance serving engine, but it is not a cookbook; it is a deployment tool. If you want fine-tuning, you might look at Axolotl or Unsloth, which are dedicated fine-tuning frameworks, but those are not mentioned in the repository. Before adopting any recipe, verify the Llama model version, the provider integration, and whether the notebook uses the Llama API or a local model. Check the archive-main branch if a link is broken. Confirm that your environment has the required dependencies, such as langchain or pytorch, which are listed as topics. The repository is a useful starting point, but it is not a substitute for a well-maintained library.

Editorial conclusion

Adopt llama-cookbook if you are a developer or researcher who wants copy-paste notebook examples for Llama inference, fine-tuning, or RAG, especially if you plan to use the hosted Llama API or third-party providers. Skip it if you need a maintained library with stable APIs, because the repo is primarily a set of examples that change with each model release. Before relying on any notebook, verify that it matches your target Llama version and provider, and check the archive-main branch if you encounter broken links after the refactor. The repository is a starting point, not a production toolkit, so treat every recipe as a template to adapt, not a drop-in solution.

Official sources

  1. License: MIT
  2. metainternal/llama-cookbook on GitHub
  3. Project website
  4. README
  5. Releases
Community notes

Community notes