Skip to main content
Fireworks provides optimized inference for open-source models with support for custom fine-tunes.
from agno.agent import Agent
from agno.models.fireworks import Fireworks

agent = Agent(
    model=Fireworks(id="accounts/fireworks/models/llama-v3p1-70b-instruct"),
    markdown=True,
)

agent.print_response("Explain microservices architecture", stream=True)

Tool Use

from agno.agent import Agent
from agno.models.fireworks import Fireworks
from agno.tools.yfinance import YFinanceTools

agent = Agent(
    model=Fireworks(id="accounts/fireworks/models/llama-v3p1-70b-instruct"),
    tools=[YFinanceTools(stock_price=True)],
    markdown=True,
)

agent.print_response("What's AMZN's stock price?", stream=True)

Structured Output

from pydantic import BaseModel, Field
from agno.agent import Agent
from agno.models.fireworks import Fireworks

class Summary(BaseModel):
    title: str = Field(..., description="Title")
    key_points: list[str] = Field(..., description="Key points")

agent = Agent(
    model=Fireworks(id="accounts/fireworks/models/llama-v3p1-70b-instruct"),
    output_schema=Summary,
)

agent.print_response("Summarize cloud computing benefits")

Run Examples

export FIREWORKS_API_KEY=xxx

git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/92_models/fireworks

python basic.py
python tool_use.py
python structured_output.py