Fireworks
Use Fireworks AI models with Kern agents.
Fireworks is a platform for providing endpoints for Large Language models.
Authentication
Set your FIREWORKS_API_KEY environment variable. Get your key from here.
1export FIREWORKS_API_KEY=***1setx FIREWORKS_API_KEY ***Prompt caching
Prompt caching will happen automatically using our Fireworks model. You can read more about how Fireworks handle caching in their docs.
Example
Use Fireworks with your Agent:
1from kern.agent import Agent2from kern.models.fireworks import Fireworks34agent = Agent(5 model=Fireworks(id="accounts/fireworks/models/firefunction-v2"),6 markdown=True7)89# Print the response in the terminal10agent.print_response("Share a 2 sentence horror story.")Note View more examples here.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "accounts/fireworks/models/llama-v3p1-405b-instruct" | 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.