Objects
An Object is versioned, serializable data. Weave automatically versions objects when they change and creates an immutable history. Objects include:- Datasets: Collections of examples for evaluation
- Models: Configurations and parameters for your LLM logic
- Prompts: Versioned prompt templates
Publish an object
Weave’s serialization layer saves and versions objects.- Python
- TypeScript
Get an object back
After publishing, you can fetch a stored object using its reference.- Python
- TypeScript
weave.publish() returns a Ref. Call .get() on any Ref to get the object back.You can construct a ref and then fetch the object back.Delete an object
If you no longer need a specific version of an object, you can remove it using its ref.- Python
- TypeScript
To delete a version of an object, call Accessing a deleted object returns an error. Resolving an object that references a deleted object returns a
.delete() on the object’s ref.DeletedRef in place of the deleted object.Construct object refs
Refs uniquely identify a stored object and version. The following sections describe the URI structure and the ways you can construct a ref. In Weave, a fully qualified object ref URI looks like this:[YOUR-TEAM-NAME]: Weights & Biases entity (username or team name)[YOUR-PROJECT-NAME]: Weights & Biases project[OBJECT-NAME]: object name[OBJECT-VERSION]: either a version hash, a string likev0orv1, or an alias like:latest. All objects have the:latestalias. See Organize object versions with tags and aliases to create your own aliases.
weave.ref([NAME]): retrieves the:latestversion of an object. Requires callingweave.init(...).weave.ref([NAME]:[VERSION]): retrieves the specified version of an object. Requires callingweave.init(...).weave.ref([FULLY-QUALIFIED-REF-URI]): retrieves the object located at the specified fully qualified object ref URI. Doesn’t require callingweave.init().
Organize object versions with tags and aliases
Use tags and aliases to label specific versions of any Weave object, includingDataset, Model, Prompt, or any other object you publish with weave.publish. These labels work on any ObjectRef, so the same APIs apply across object types.
- Alias: A unique name that resolves to a single version. You can move an alias to a different version at any time, making it useful for stable references like
productionorstaging. Every object automatically has a:latestalias that points to the most recent version. - Tag: A descriptive label attached to a version. A version can have multiple tags, and the same tag can appear on multiple versions. Use tags to categorize and filter versions, such as
reviewedorpassed-eval.
Naming rules
Object names, tags, and aliases must follow these rules. Weave rejects a tag or alias that breaks them.
Before publishing an object, the Python SDK checks its name against the following rules and rewrites it as necessary:
- Replaces each run of characters other than letters, numbers, underscores, and periods with a single hyphen.
- Replaces each run of two or more periods, underscores, or hyphens with a single hyphen.
- Removes hyphens and underscores from the start and end of the name.
- If the name is still longer than 128 characters, keeps the first 128 and logs a warning.
weave.publish() raises a ValueError. The ref that weave.publish() returns carries the rewritten name, so use that name to get the object back:
The TypeScript SDK doesn’t rewrite a name that you pass to client.publish(). If the name breaks the object name rules, the request fails.
For Op name and Call display name limits, see Name length limits.