This package provides drop-in replacements for various LLM API clients that automatically log usage data to CSV files.
- Fireworks: Wrapper for Fireworks AI client ✅
- Together: Wrapper for Together AI client (TODO)
- Cohere: Wrapper for Cohere AI client (TODO)
uv pip install -e .Set your API key as an environment variable:
export FIREWORKS_API_KEY="your-api-key-here"Simply replace your import statement:
Before:
from fireworks.client import FireworksAfter:
from iearena import FireworksEverything else works exactly the same! The wrapper is completely transparent and maintains the same API.
import os
from iearena import Fireworks
# Initialize client (same as before)
client = Fireworks(api_key=os.getenv("FIREWORKS_API_KEY"))
# Use the same API
response = client.completion.create(
model="accounts/fireworks/models/llama4-scout-instruct-basic",
prompt="What is the capital of France?",
max_tokens=10,
temperature=0.1
)
print(f"Response: {response.choices[0].text}")
# Usage data is automatically logged to 'fireworks_usage_log.csv'- Transparent: Works exactly like the original Fireworks client
- Automatic logging: No code changes needed beyond the import
- CSV output: Logs to
fireworks_usage_log.csvin the current directory - Streaming support: Works with both streaming and non-streaming completions
- Append mode: New usage data is appended to existing CSV files
The CSV file contains the following columns:
timestamp: ISO format timestamp of the requestinput_length: Number of prompt tokensoutput_length: Number of completion tokensprompt: The actual prompt text sent to the model
timestamp,input_length,output_length,prompt
2025-05-26T22:04:54.251253,12,50,Write a short story about a robot learning to paint:
2025-05-26T22:06:10.776823,8,10,What is the capital of France?- Python 3.10+
fireworks-aipackage- Valid Fireworks API key
The wrapper requires the original fireworks-ai package to be installed, as it acts as a transparent proxy that adds logging functionality.