Fireworks
Use Fireworks AI models with Agno agents.
Fireworks provides hosted, OpenAI-compatible endpoints for open large language models.
Authentication
Create a Fireworks API key, then set the FIREWORKS_API_KEY environment variable.
export FIREWORKS_API_KEY="your_value_here"Prompt caching
Prompt caching happens automatically when you use the Fireworks model. Read more about how Fireworks handles caching in their docs.
Example
Install the openai package:
uv pip install -U openai agnoUse Fireworks with your Agent:
from agno.agent import Agent
from agno.models.fireworks import Fireworks
agent = Agent(
model=Fireworks(id="accounts/fireworks/models/gpt-oss-120b"),
markdown=True
)
# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "accounts/fireworks/models/gpt-oss-120b" | The ID of the Fireworks model to use |
name | str | "Fireworks" | The name of the model |
provider | str | "Fireworks" | The provider of the model |
api_key | Optional[str] | None | The API key for Fireworks (defaults to FIREWORKS_API_KEY env var) |
base_url | str | "https://api.fireworks.ai/inference/v1" | The base URL for the Fireworks API |
Fireworks extends the OpenAI-compatible interface and supports most parameters from the OpenAI model.