Fireworks AI
Use Fireworks AI with Blazen — construct the FireworksProvider and call complete().
Fireworks AI is an OpenAI-compatible LLM provider. Construct it like any other Blazen provider — build a list of ChatMessages, call complete() (or stream()), and read back a typed ModelResponse.
At a glance
| Provider id | fireworks |
| Base URL | https://api.fireworks.ai/inference/v1 |
| Default model | accounts/fireworks/models/llama-v3p3-70b-instruct |
| API key env var | FIREWORKS_API_KEY |
| Auth | Authorization: Bearer <key> |
Set FIREWORKS_API_KEY in the environment and Blazen reads it automatically, or pass the key explicitly when you construct the provider.
Capabilities
| Capability | Supported |
|---|---|
| Streaming | Yes |
| Tool calling | Yes |
| Structured output | Yes |
| Vision | Yes |
| Model listing | Yes |
| Embeddings | Yes |
Usage
Construct the provider and call complete(). The default model is accounts/fireworks/models/llama-v3p3-70b-instruct; override it with with_model / model when you need a different one.
use blazen_llm::{Model, ModelRequest, ChatMessage};
use blazen_provider_fireworks::FireworksProvider;
// Reads FIREWORKS_API_KEY from the environment, or pass the key to `new`.
let model = FireworksProvider::new(std::env::var("FIREWORKS_API_KEY")?);
let resp = model
.complete(ModelRequest::new(vec![ChatMessage::user("Hello")]))
.await?;
println!("{}", resp.content.unwrap_or_default());
from blazen import FireworksProvider, ProviderOptions, ChatMessage
# Omit the api_key to read FIREWORKS_API_KEY from the environment.
model = FireworksProvider(options=ProviderOptions(api_key="..."))
resp = await model.complete([ChatMessage.user("Hello")])
print(resp.content)
import { FireworksProvider, ChatMessage } from "blazen";
// Omit apiKey to read FIREWORKS_API_KEY from the environment.
const model = FireworksProvider.create({ apiKey: "..." });
const resp = await model.complete([ChatMessage.user("Hello")]);
console.log(resp.content);
Streaming
async for chunk in model.stream([ChatMessage.user("Count to five")]):
print(chunk.delta, end="")
await model.stream([ChatMessage.user("Count to five")], (chunk) => {
if (chunk.delta) process.stdout.write(chunk.delta);
});
See also
- Models & Providers — the canonical provider +
ModelManagerguide