Skip to main content

Requirements

Env variables

Initialize Logger

The first step is to set up the Maxim logger that will capture and track your Fireworks API calls. This logger connects to your Maxim dashboard where you can monitor performance, costs, and usage patterns.

Initialize Fireworks Client with Maxim

Once you have the logger, you need to instrument the Fireworks SDK to automatically capture all API calls. The instrument_fireworks function wraps the Fireworks client to send observability data to Maxim.

Make LLM Calls Using Fireworks Client

After instrumentation, all your Fireworks API calls will be automatically logged to Maxim. You can use the Fireworks client exactly as you normally would - no additional code needed for logging.

Streaming Support

Fireworks supports streaming responses, providing real-time output. Maxim automatically tracks streaming calls, capturing the full conversation flow and performance metrics.

Make Streaming Calls

Tool Calls

Fireworks allows you to define and use tool calls within your LLM applications. These calls are also logged to Maxim for complete observability.

What Gets Logged to Maxim

When you use Fireworks with Maxim instrumentation, the following information is automatically captured for each API call:
  • Request Details: Model name, parameters, and all other settings
  • Message History: Complete conversation context including user messages
  • Response Content: Full assistant responses and metadata
  • Usage Statistics: Input tokens, output tokens, total tokens consumed
  • Cost Tracking: Estimated costs based on Fireworks’ pricing
  • Error Handling: Any API errors or failures with detailed context

Resources

Fireworks integration cookbook (GitHub)