Cloudflare Workers AI Integration
Opik provides seamless integration with Cloudflare Workers AI allowing you to trace, monitor, and debug your Cloudflare Workers AI applications.
Features
- Comprehensive Tracing: Automatically trace Cloudflare Workers AI requests
- Hierarchical Visualization: View your Cloudflare Workers AI requests as structured traces with parent-child relationships
- Custom Tagging: Add custom tags to organize and filter your traces
Installation
Option 1: Using npm
Option 2: Using yarn
Requirements
- Node.js ≥ 18
- Opik SDK
Enable Node.js compatibility mode
The Opik SDK requires Node.js compatibility mode to be enabled in Cloudflare Workers AI. You can enable it by adding the following to your wrangler.toml
file:
See the Cloudflare documentation for more details.
Basic Usage
Using with LLM Calls
Here is an example of how to use the Opik SDK with Cloudflare Workers AI: