Skip to main content
Use FireworksAI models with Hypertic agent.

Installation

Install the OpenAI package (FireworksAI uses OpenAI-compatible API):
pip install hypertic[openai]

Setup

Set your FireworksAI API key as an environment variable:
export FIREWORKS_API_KEY=...

Initialize Model

Create a FireworksAI model instance:
from hypertic.models import FireworksAI
import os

model = FireworksAI(
    api_key=os.getenv("FIREWORKS_API_KEY"),
    model="fireworks/glm-4p7",
)

Use with Agent

Pass the model to your agent:
from hypertic.agents import Agent
from hypertic.models import FireworksAI
import os

model = FireworksAI(
    api_key=os.getenv("FIREWORKS_API_KEY"),
    model="fireworks/glm-4p7",
)
agent = Agent(
    model=model,
    tools=[get_weather],
)

response = agent.run("What's the weather in SF?")
print(response.content)

Configuration Options

Supported parameters for FireworksAI models:
from hypertic.models import FireworksAI
import os

model = FireworksAI(
    api_key=os.getenv("FIREWORKS_API_KEY"),
    model="fireworks/glm-4p7",
    temperature=0.7,
    max_tokens=1000,
)
For the full list of available models and parameters, see the FireworksAI API documentation.