Class FireworksAIClient

All Implemented Interfaces:
com.tnsai.llm.LLMClient

public class FireworksAIClient extends AbstractOpenAICompatibleClient
Fireworks.ai LLM client.

Fireworks hosts open models behind an OpenAI-compatible API at https://api.fireworks.ai/inference/v1. The wire format matches every other OpenAI-shape provider in this module (GroqClient, OpenRouterClient, NvidiaNIMClient, XAIGrokClient, CerebrasClient, TogetherAIClient), so this client is a thin same-shape addition.

Distinguishes itself with firefunction-v2 — a function-calling-tuned model that tops the Berkeley Function Calling Leaderboard for open-weight tool-use accuracy. Mention this in the model field to route a tool-use loop specifically at FireFunction.

Supported models (at time of writing — the catalogue evolves quickly, check the live list at fireworks.ai/models):

  • accounts/fireworks/models/firefunction-v2 — function-calling-tuned (FireFunction)
  • accounts/fireworks/models/llama-v3p3-70b-instruct — Llama 3.3 70B
  • accounts/fireworks/models/llama-v3p1-405b-instruct — Llama 3.1 405B (frontier)
  • accounts/fireworks/models/llama-v3p1-8b-instruct — Llama 3.1 8B (fast / cheap)
  • accounts/fireworks/models/mixtral-8x7b-instruct — Mixtral 8x7B
  • accounts/fireworks/models/qwen2p5-72b-instruct — Qwen 2.5 72B
  • accounts/fireworks/models/deepseek-v3 — DeepSeek V3

Configuration via environment variables:

  • FIREWORKS_API_KEY — Required.
  • FIREWORKS_BASE_URL — Optional override, defaults to https://api.fireworks.ai/inference/v1.
See Also:
  • Constructor Details

    • FireworksAIClient

      public FireworksAIClient(String model)
    • FireworksAIClient

      public FireworksAIClient(String model, float temperature)
    • FireworksAIClient

      public FireworksAIClient(String model, float temperature, Integer maxTokens)
    • FireworksAIClient

      public FireworksAIClient(String model, float temperature, Float topP, Integer maxTokens)
    • FireworksAIClient

      public FireworksAIClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey)
    • FireworksAIClient

      public FireworksAIClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey)