An unofficial Go port of the official Fireworks AI Python SDK. It targets Python SDK 1.2.0-alpha.76 and keeps the Go package version aligned exactly, giving Go teams typed and generic access to Fireworks inference, management, datasets, and training workflows.
Python SDK parity focus: generated resource coverage, generated type exports, request serialization, retries, errors, SSE streaming, file uploads, account resolution, FireTitan training lifecycle helpers, and opt-in live contract tests.
⚠️ Disclaimer: This is an unofficial SDK and is not affiliated with, endorsed by, or supported by Fireworks AI. For official support, use the Fireworks AI documentation and support channels.
Fireworks AI exposes high-performance inference, fine-tuning, deployments, datasets, and training infrastructure. This SDK brings that workflow into idiomatic Go while preserving behavior parity with the official Python client.
Use typed APIs when you want compile-time structure, generic APIs when you need flexibility, and raw request helpers for endpoints that are not yet represented by generated resource methods.
Most resources expose generated typed methods plus flexible map[string]any methods for fast iteration.
Create Fireworks chat completions with Python-compatible JSON fields and generated Go structs.
Streaming uses Server-Sent Events and exposes an idiomatic stream iterator for incremental responses.
Upload small dataset files directly or use signed upload endpoints for larger training datasets.
List responses include helper methods for checking and requesting subsequent result pages.
Mirrors Python SDK behavior for status errors, retry headers, request metadata, timeouts, and connection errors.
Supports per-request account IDs, client-level defaults, and FIREWORKS_ACCOUNT_ID environment fallback.
Includes trainer jobs, deployments, hotload, sampler clients, managed provisioning, and checkpoint promotion helpers.
Use Go 1.22 or newer.
go get github.com/ZaguanLabs/fireworks-sdk-goThe client reads FIREWORKS_API_KEY by default.
export FIREWORKS_API_KEY="fw_..."package main
import (
"context"
"fmt"
fireworks "github.com/ZaguanLabs/fireworks-sdk-go"
"github.com/ZaguanLabs/fireworks-sdk-go/types"
)
func main() {
ctx := context.Background()
client, err := fireworks.NewClient()
if err != nil {
panic(err)
}
resp, err := client.Chat.Completions.CreateTyped(ctx, types.ChatCompletionCreateParams{
Model: "accounts/fireworks/models/kimi-k2-instruct-0905",
Messages: []types.SharedParamsChatMessage{
{Role: "user", Content: "How do LLMs work?"},
},
})
if err != nil {
panic(err)
}
fmt.Println(resp.Choices[0].Message.Content)
}stream, err := client.Chat.Completions.CreateTypedStream(ctx, types.ChatCompletionCreateParams{
Model: "accounts/fireworks/models/kimi-k2-instruct-0905",
Messages: []types.SharedParamsChatMessage{
{Role: "user", Content: "How do LLMs work?"},
},
})
if err != nil {
return err
}
defer stream.Close()
for stream.Next() {
chunk := stream.Current()
if len(chunk.Choices) > 0 {
fmt.Print(chunk.Choices[0].Delta.Content)
}
}
if err := stream.Err(); err != nil {
return err
}Choose raw maps for rapid prototyping or generated typed structs for safer production integrations.
raw, err := client.Models.Get(ctx, "my-model")
model, err := client.Models.GetTyped(ctx, "my-model", types.ModelGetParams{})Use raw helpers for custom or undocumented endpoints without waiting for generated resource coverage.
resp, err := client.Raw(ctx, "POST", "/v1/custom/path", map[string]any{
"my_param": true,
})The FireTitan training layer ports the Fireworks Python training SDK into Go, including trainer jobs, deployments, hotload flows, sampler clients, managed provisioning, checkpoint promotion, and setup helpers.
Live tests are opt-in through FIREWORKS_SDK_GO_LIVE and can run read-only account smoke checks with only FIREWORKS_API_KEY. Resource-specific trainer, deployment, and checkpoint tests require additional environment variables.
go run ./cmd/fireworks-training setup-trainer --display-name ablation-eager --extra-args "--forward-only --no-compile" --custom-image-tag your-image-tag