# Use the function
result = analyze_text_with_fireworks("Open source AI models are becoming increasingly powerful.")
```

![Fireworks AI Function Tracing with @track Decorator](https://files.buildwithfern.com/https://opik.docs.buildwithfern.com/docs/opik/2026-01-30T17:33:07.444Z/img/tracing/fireworks_ai_integration_2.png)

### Streaming Responses

Fireworks AI supports streaming responses, which are also tracked by Opik:

```python
response = tracked_client.chat.completions.create(
    model="accounts/fireworks/models/llama-v3p1-8b-instruct",
    messages=[
        {"role": "user", "content": "Explain quantum computing in simple terms."}
    ],
    stream=True
)

for chunk in response:
    if chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="")
```

## Supported Models

Fireworks AI provides fast inference for a wide range of popular open-source models. Some of the popular models available include:

* **Llama Models**: `accounts/fireworks/models/llama-v3p1-8b-instruct`, `accounts/fireworks/models/llama-v3-70b-instruct`
* **Mistral Models**: `accounts/fireworks/models/mixtral-8x7b-instruct-hf`, `accounts/fireworks/models/mistral-7b-instruct-v0.1`
* **Qwen Models**: `accounts/fireworks/models/qwen-72b-chat`, `accounts/fireworks/models/qwen-14b-chat`
* **Code Models**: `accounts/fireworks/models/starcoder-16b`, `accounts/fireworks/models/codellama-34b-instruct-hf`

For the complete list of available models, visit the [Fireworks AI model catalog](https://fireworks.ai/models).

## Results Viewing

Once your Fireworks AI calls are logged with Opik, you can view detailed traces in your Opik dashboard. Each API call will create a trace that includes:

* Input prompts and messages
* Model parameters and configuration
* Response content and metadata
* Token usage statistics
* Timing information
* Any custom metadata you've added

## Troubleshooting

### Common Issues

**API Key Issues**: Ensure your `FIREWORKS_API_KEY` environment variable is set correctly and has sufficient credits.

**Model Name Format**: Fireworks AI models use the format `accounts/fireworks/models/{model-name}`. Make sure you're using the correct model identifier.

**Rate Limiting**: Fireworks AI has rate limits based on your plan. If you encounter rate limiting, consider implementing exponential backoff in your application.

**Base URL**: The base URL for Fireworks AI is `https://api.fireworks.ai/inference/v1`. Ensure you're using the correct endpoint.

### Getting Help

If you encounter issues with the integration:

1. Check your API key and model names
2. Verify your Opik configuration
3. Check the [Fireworks AI documentation](https://docs.fireworks.ai/)
4. Review the [Opik OpenAI integration documentation](/integrations/openai)

## Environment Variables

Make sure to set the following environment variables:

```bash