Registry / llm-agents / weave
library0.53.7pypypi✓ verified 22d ago

Weave by Weights & Biases is a Python toolkit designed for developing, observing, and evaluating Generative AI applications. It enables users to log and debug inputs, outputs, and traces of language models, build rigorous evaluations, and organize information across the LLM workflow, from experimentation to production. The library is currently at version 0.52.36 and has an active release cadence.

pip install weave
INSTALL
IMPORT
SIG · WEAVE
W
weave
llm-agentspythonv0.53.7
Install
14.7s avg
Import
4099ms
Disk
176MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 4.476s · 156.8MB
glibc
py 3.103.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.

weave
import weave
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
Debug
Known issues
gotchaThere is an older, unrelated Python library also named 'weave' (scipy.weave) for embedding C/C++ code. Ensure you are installing and importing the 'weave' library from Weights & Biases for AI application development.
fix
Always verify the source and purpose of the 'weave' package; for AI/LLM use cases, it's `pip install weave` from Weights & Biases.
affects: All versions
gotchaCustom Python objects in Weave traces might be truncated if not explicitly converted. For full data retention of complex objects, ensure they are converted into a dictionary of strings before logging.
fix
Implement a `to_dict()` method on custom objects or explicitly convert them to a dictionary of strings (e.g., `{'key': str(obj_value)}`) before they are passed to Weave operations.
affects: All versions
breakingWeave requires Python 3.10 or higher. Older Python versions are not supported.
fix
Upgrade your Python environment to version 3.10 or newer.
affects: <3.10
gotchaWeave's `.call()` method captures exceptions by default, storing them in `call.exception` rather than re-raising. This can obscure immediate error feedback.
fix
To force exceptions to be re-raised during execution, set the `__should_raise=True` parameter when calling an `@weave.op` decorated function (e.g., `my_op.call(__should_raise=True)`).
affects: All versions
gotchaFull functionality and logging require authentication with a Weights & Biases account. Your W&B API key must be provided.
fix
Set the `WANDB_API_KEY` environment variable or pass `api_key` to `weave.init()` (though environment variables are recommended for security) before running Weave-enabled code.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'weave'
The 'weave' package is not installed in the current Python environment.
fix
pip install weave
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.
fix
Run `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.
fix
Access 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.
Agent activity
67 hits · last 30 days
node
60
Perplexity
1
OpenAI (training)
1
Resources
weave — pip install weave · libregistry