Skip to content

Support Llama API in crewAI #2825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/concepts/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,39 @@ In this section, you'll find detailed examples that help you select, configure,
| o1 | 200,000 tokens | Fast reasoning, complex reasoning |
</Accordion>

<Accordion title="Meta-Llama">
Meta's Llama API provides access to Meta's family of large language models.
The API is available through the [Meta Llama API](https://llama.developer.meta.com?utm_source=partner-crewai&utm_medium=website).
Set the following environment variables in your `.env` file:

```toml Code
# Meta Llama API Key Configuration
LLAMA_API_KEY=LLM|your_api_key_here
```

Example usage in your CrewAI project:
```python Code
from crewai import LLM

# Initialize Meta Llama LLM
llm = LLM(
model="meta_llama/Llama-4-Scout-17B-16E-Instruct-FP8",
temperature=0.8,
stop=["END"],
seed=42
)
```

All models listed here https://llama.developer.meta.com/docs/models/ are supported.

| Model ID | Input context length | Output context length | Input Modalities | Output Modalities |
| --- | --- | --- | --- | --- |
| `meta_llama/Llama-4-Scout-17B-16E-Instruct-FP8` | 128k | 4028 | Text, Image | Text |
| `meta_llama/Llama-4-Maverick-17B-128E-Instruct-FP8` | 128k | 4028 | Text, Image | Text |
| `meta_llama/Llama-3.3-70B-Instruct` | 128k | 4028 | Text | Text |
| `meta_llama/Llama-3.3-8B-Instruct` | 128k | 4028 | Text | Text |
</Accordion>

<Accordion title="Anthropic">
```toml Code
# Required
Expand Down