Skip to main content

Weaver Python SDK

PyPI version Python CI

English | 中文

Python client for the NexWeave Weaver server. The SDK mirrors the REST API exposed by weaver-server and provides ergonomic helpers for training, sampling, telemetry, and operations management.

Installing locally

pip install nex-weaver

Configuration

Configuration can be provided via keyword arguments or environment variables:

  • WEAVER_API_KEY
  • WEAVER_ORGANIZATION_ID / WEAVER_PROJECT_ID for canonical IDs
  • WEAVER_ORGANIZATION / WEAVER_PROJECT for UUIDs, slugs, or display names

Canonical IDs take precedence. When no organization or project is configured, the server keeps its stable personal-organization/default-project fallback.

Quickstart

from weaver import ServiceClient

def main():
    with ServiceClient() as client:
        session = client.ensure_session()
        print(session)

if __name__ == "__main__":
    main()

Give a new Session an optional experiment name and searchable string labels while selecting its scope by human-readable references:

with ServiceClient(
    organization="research",
    project="alignment",
    name="PPO baseline",
    labels={"dataset": "math", "environment": "staging"},
) as client:
    client.ensure_session()

Empty name/labels are omitted from the create request, preserving compatibility with legacy servers and existing call sites.

weaver organizations list
weaver projects list --organization research
weaver scope resolve --organization research --project alignment

Organization slugs are globally unique. Project slugs and names are unique inside their organization; an ambiguous display name is rejected instead of guessed.

Usage

See examples/weaver_walkthrough.ipynb for an interactive walkthrough of the full SDK workflow using a Pig Latin translation task — covering data preparation, LoRA / full fine-tuning, sampling, and checkpoint management.

For a complete runnable script, see examples/pig_latin.py. For large packed datasets, examples/streaming_sft.py shows bounded token-budget batching and submit-ahead.

Generation control (full fine-tuning only)

RL weight swaps need in-flight generation to stop before new weights land. A sampling client can freeze its inference engine and resume it afterwards:

with sampling_client.paused(mode=PauseMode.ABORT):
    path = training_client.save_weights_for_sampler(name="step-42")
    new_client = service.create_sampling_client(
        model_path=path, model_id=model_id, base_model=base_model
    )

Two things to know before using it:

  • The pause is engine-wide, not per sampling session. It freezes every in-flight request on the engine serving that model, including ones issued through an earlier sampling session. That is what makes it usable for weight swaps — the requests you want to abort belong to the previous weight epoch — but it also means a pause is never scoped to "just my requests".
  • Full fine-tuning only. Those models get a dedicated engine. LoRA adapters are served from one shared engine per base model, where a pause would abort generation for unrelated tenants, so the call is rejected before any request is sent.

Prefer paused() over calling pause_generation() / continue_generation() directly: a pause that never reaches its resume leaves the engine frozen indefinitely, and there is no server-side auto-resume. The async client mirrors this as async with.

Ecosystem

NexRL is the companion RL training framework. In its training-service mode, NexRL orchestrates the full RL loop (rollouts, trajectory collection, policy updates) while Weaver handles the underlying training and inference services.

Use Cases

OpenClaw Autonomous LearningMetaClaw has integrated Weaver as an RL backend. By setting rl.backend=weaver, MetaClaw turns every live conversation into a learning signal and uses Weaver for cloud-based LoRA training, enabling personal agents to continuously evolve without a local GPU.

Deep Dive

For more technical details, see Deep Dive into Weaver.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nex_weaver-1.12.0.tar.gz (100.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nex_weaver-1.12.0-py3-none-any.whl (91.4 kB view details)

Uploaded Python 3

File details

Details for the file nex_weaver-1.12.0.tar.gz.

File metadata

  • Download URL: nex_weaver-1.12.0.tar.gz
  • Upload date:
  • Size: 100.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nex_weaver-1.12.0.tar.gz
Algorithm Hash digest
SHA256 c0aaa1cbbf67bca5da85019a34eb02ed1133920c329e98949a0e1a3d515c7cef
MD5 4104d790f3cd49380c22d4f368a6690f
BLAKE2b-256 ba1ec77b1e551d79c1ed70c9c9a767dc0680ddf2546e09781d8ac363a0d715db

See more details on using hashes here.

Provenance

The following attestation bundles were made for nex_weaver-1.12.0.tar.gz:

Publisher: publish.yml on nex-agi/weaver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nex_weaver-1.12.0-py3-none-any.whl.

File metadata

  • Download URL: nex_weaver-1.12.0-py3-none-any.whl
  • Upload date:
  • Size: 91.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nex_weaver-1.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 808a5dfa0c946920b89a8fb03e5334d58b76a471cd46d584b610ad2845c1aaa4
MD5 b6f1eb517b89952b420ee5a6efe9b04f
BLAKE2b-256 4ec342f9cb5ef255bcaee403a97d412c1addcf9c38058cab3fa058ffcd6c3147

See more details on using hashes here.

Provenance

The following attestation bundles were made for nex_weaver-1.12.0-py3-none-any.whl:

Publisher: publish.yml on nex-agi/weaver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.14.0

2 files

1.13.0

2 files

This release

1.12.0 This release

2 files

1.10.0

2 files

1.9.0

2 files

1.7.0.4

2 files

1.7.0.3

2 files

1.7.0.2

2 files

1.7.0.1

2 files

1.7.0

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.7

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page