Install & Compatibility
Where this runs
tested against v0.53.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 4.476s · 156.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 14.7s · import 3.722s · 160MB
176MB installed
● package 176MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
op
✓ from weave import op
✗ import weave.op
The `op` decorator is typically imported directly or accessed as `weave.op` after a general `import weave`.
This quickstart demonstrates how to initialize Weave, decorate a function with `@weave.op` to trace its execution, and capture LLM interactions. It uses OpenAI as an example, requiring both W&B and OpenAI API keys.
import os
import weave
from openai import OpenAI
# Ensure you have your Weights & Biases API key set as an environment variable
# os.environ['WANDB_API_KEY'] = 'YOUR_WANDB_API_KEY'
# Ensure you have your OpenAI API key set as an environment variable
# os.environ['OPENAI_API_KEY'] = 'YOUR_OPENAI_API_KEY'
# Initialize Weave with your project name
# This will create a new project or connect to an existing one in W&B
weave.init(project_name=os.environ.get('WANDB_PROJECT_NAME', 'my-llm-project'))
client = OpenAI()
@weave.op()
def extract_dinos(sentence: str) -> dict:
"""Extracts dinosaur names and diets from a sentence using OpenAI."""
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": "In JSON format extract a list of `dinosaurs`, with their `name`, their `common_name`, and whether its `diet` is a herbivore or carnivore."},
{"role": "user", "content": sentence}
],
response_model=dict # Placeholder if a Pydantic model is not used here
)
return response.choices[0].message.content if response.choices else {}
@weave.op()
def main():
sentence = "The mighty Tyrannosaurus Rex (T-Rex), a carnivore, hunted the herbivorous Triceratops."
dinosaur_info = extract_dinos(sentence)
print("Extracted Dinosaur Info:", dinosaur_info)
if __name__ == "__main__":
main()
weave --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'weave'
The 'weave' package is not installed in the current Python environment.
wandb: ERROR W&B API key not found. Please set the WANDB_API_KEY environment variable or run 'wandb login'.
Weave attempts to log data to Weights & Biases but the user is not authenticated with a W&B account.
fixRun `wandb login` in your terminal and follow the prompts, or set the `WANDB_API_KEY` environment variable.
AttributeError: module 'weave' has no attribute 'panel'
The user is trying to access 'panel' directly from the 'weave' module, but the panel components are located in the 'weave.panels' submodule.
fixAccess panels from the correct submodule, for example: `import weave.panels as wp` and then use `wp.Panel(...)`.
Upgrade
Version history
0.53.7latest on PyPI · released Aug 27, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or higher.
wandbrequiredWeave is built by Weights & Biases and integrates with W&B for project management, logging, and visualization. An account is required for full functionality.