Skip to main content

Weave by Weights & Biases

Open in Colab Stable Version Download Stats Github Checks codecov

Weave is a toolkit for developing Generative AI applications, built by Weights & Biases.


You can use Weave to:

  • Log and debug language model inputs, outputs, and traces
  • Build rigorous, apples-to-apples evaluations for language model use cases
  • Organize all the information generated across the LLM workflow, from experimentation to evaluations to production

Our goal is to bring rigor, best-practices, and composability to the inherently experimental process of developing Generative AI software, without introducing cognitive overhead.

Documentation

Our documentation site can be found here.

Prerequisites

Quick Start

  1. Install Weave:

    pip install weave
    
  2. Import and initialize:

    import weave
    weave.init("my-project-name")
    
  3. Trace your functions:

    @weave.op
    def my_function():
        # Your tracked code!
        pass
    

Usage

Tracing

You can trace any function using weave.op - from api calls to OpenAI, Anthropic, Google AI Studio etc to generation calls from Hugging Face and other open source models to any other validation functions or data transformations in your code you'd like to keep track of.

Decorate all the functions you want to trace, this will generate a trace tree of the inputs and outputs of all your functions:

import weave
weave.init("weave-example")

@weave.op
def sum_nine(value_one: int):
    return value_one + 9

@weave.op
def multiply_two(value_two: int):
    return value_two * 2

@weave.op
def main():
    output = sum_nine(3)
    final_output = multiply_two(output)
    return final_output

main()

Fuller Example

import weave
import json
from openai import OpenAI

@weave.op
def extract_fruit(sentence: str) -> dict:
    client = OpenAI()

    response = client.chat.completions.create(
    model="gpt-3.5-turbo-1106",
    messages=[
        {
            "role": "system",
            "content": "You will be provided with unstructured data, and your task is to parse it one JSON dictionary with fruit, color and flavor as keys."
        },
        {
            "role": "user",
            "content": sentence
        }
        ],
        temperature=0.7,
        response_format={ "type": "json_object" }
    )
    extracted = response.choices[0].message.content
    return json.loads(extracted)

weave.init('intro-example')

sentence = "There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy."

extract_fruit(sentence)

Contributing

Interested in pulling back the hood or contributing? Awesome, before you dive in, here's what you need to know.

We're in the process of 🧹 cleaning up 🧹. This codebase contains a large amount code for the "Weave engine" and "Weave boards", which we've put on pause as we focus on Tracing and Evaluations.

The Weave Tracing code is mostly in: weave/trace and weave/trace_server.

The Weave Evaluations code is mostly in weave/flow.

Release files for weave 0.53.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weave 0.53.9
File Size Uploaded
weave-0.53.9.tar.gz 1.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for weave 0.53.9
File Interpreter ABI Platform
weave-0.53.9-py3-none-any.whl Python 3 none any Details

Total release size: 3.1 MB

Release files / weave-0.53.9.tar.gz

Download URL weave-0.53.9.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
f3c7a7c40a1f817ee89db4b754f849a79e426e7e677bae8e5623c02f2535a5fd
BLAKE2b-256 checksum
How to use checksums
d7b513e3de57a603e2ead6d85054ad731a05decc3065edee4c13a839deb2bfdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / weave-0.53.9-py3-none-any.whl

Download URL weave-0.53.9-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3a2cfbb1239458379746722604d7122a6d2b2ffd808ad12de6ae7e6f8bd6fd90
BLAKE2b-256 checksum
How to use checksums
02d14d8881311f9f9b01d7c1613dcc984c7c55f0235cdc194881d987aca82fdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.53.9 This release

2 release files

0.53.7

2 release files

0.53.6

2 release files

0.53.4

2 release files

0.53.3

2 release files

0.53.2

2 release files

0.53.0

2 release files

0.52.9

2 release files

0.52.8

2 release files

0.52.7

2 release files

0.52.5

2 release files

0.52.4

2 release files

0.52.3

2 release files

0.52.2

2 release files

0.52.1

2 release files

0.51.9

2 release files

0.51.8

2 release files

0.51.7

2 release files

0.51.6

2 release files

0.51.5

2 release files

0.51.1

2 release files

0.51.0

2 release files

0.50.9

2 release files

0.50.8

2 release files

0.50.6

2 release files

0.50.5

2 release files

0.50.4

2 release files

0.50.3

2 release files

0.50.1

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.40.0

2 release files

0.39.0

2 release files

0.38.0

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.31.0

2 release files

0.28.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page