Principle:Wandb Weave Integration Configuration
| Knowledge Sources | |
|---|---|
| Domains | Instrumentation, Configuration |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
A per-provider configuration mechanism that controls how individual LLM integrations are patched and traced.
Description
Integration Configuration allows users to explicitly enable, disable, or customize tracing for specific LLM providers. Each provider has a dedicated patch_*() function that accepts IntegrationSettings for fine-grained control over op settings (sampling rate, display names, etc.).
Usage
Use this principle when you need explicit control over which providers are traced or when configuring provider-specific tracing settings. This is an alternative to the automatic patching provided by weave.init().
Theoretical Basis
Provider-specific configuration follows the strategy pattern:
- Each integration has a dedicated patch function (patch_openai, patch_anthropic, etc.).
- The function accepts IntegrationSettings to customize behavior.
- Patched integrations are tracked in a global set (_PATCHED_INTEGRATIONS) to prevent double-patching.
- The _patch_integration helper centralizes the logic: import the provider module, call its patcher getter function, and apply MultiPatcher.attempt_patch().