fireworks

package module
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fireworks wraps Fireworks AI's OpenAI-compatible API. Fireworks hosts open-weight models on its FireAttention serving stack and ships latency-optimized custom variants of popular models.

Fireworks-specific knobs reachable through the namespaced OpenAI request extension:

  • "context_length_exceeded_behavior" controls truncation policy.
  • "prompt_cache_max_len" enables Fireworks' prompt-cache layer.
  • The /chat/completions endpoint accepts "response_format" with "type":"grammar" to constrain output via GBNF (alongside the standard "json_schema").

See https://docs.fireworks.ai/ for the full API reference.

Index

Constants

View Source
const (
	OpenAIRequestExtensionKey     = "fireworks/openai_request"
	OpenAIResponseExtensionKey    = "fireworks/openai_response"
	OpenAIStreamChunkExtensionKey = "fireworks/openai_stream_chunk"
)
View Source
const (
	Provider = "Fireworks"

	BaseURL = "https://api.fireworks.ai/inference/v1"
)
View Source
const (
	ModelGPTOSS20B = "accounts/fireworks/models/gpt-oss-20b"
	ModelKimiK26   = "accounts/fireworks/models/kimi-k2p6"
	ModelGLM52     = "accounts/fireworks/models/glm-5p2"
)

Current serverless model ids. See https://fireworks.ai/models for the live catalog — Fireworks prefixes model ids with "accounts/fireworks/models/".

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat added in v0.13.0

type Chat = openai.ChatCompletions

Chat implements Fireworks' chat endpoint.

func NewChat added in v0.13.0

func NewChat(config ChatConfig) (*Chat, error)

type ChatConfig added in v0.13.0

type ChatConfig struct {
	APIKey         string
	DefaultOptions corechat.Options
	BaseURL        string
	HTTPClient     *http.Client
}

func (ChatConfig) Validate added in v0.13.0

func (c ChatConfig) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL