Skip to main content

Victor Rust Workspace

Rust libraries, the standalone edge runtime, and high-performance Python extensions for Victor.

Packages

Workspace member Distribution Purpose
crates/protocol crates.io: victor-protocol Portable message and tool-call contracts
crates/state crates.io: victor-state Conversation and scoped state management
crates/tools crates.io: victor-tools Tool schema registry and validation
crates/edge-runtime crates.io: victor-edge Standalone edge agent runtime and binary
crates/python-bindings PyPI: victor_native Python native extensions; never published to crates.io

victor-edge depends on the other three Rust crates, so crates.io publication is intentionally ordered as protocol → state → tools → edge.

Features

  • Deduplication (dedup): Rolling hash-based content deduplication using xxHash3
  • Similarity (similarity): SIMD-optimized cosine similarity for embeddings
  • JSON Repair (json_repair): Fast JSON repair with streaming parser
  • Hashing (hashing): High-performance signature hashing for loop detection

Performance

Operation Python Rust Speedup
Block deduplication 1.0ms 0.02ms ~50x
Cosine similarity (384d, 100 vectors) 5.0ms 1.0ms ~5x
JSON repair 0.5ms 0.05ms ~10x
Signature hashing 0.2ms 0.02ms ~10x

Building

Prerequisites

  • Rust 1.70+ (install via rustup)
  • Python 3.10+
  • maturin (pip install maturin)

Development Build

cd rust

# Build and install in development mode
maturin develop

# Build with optimizations
maturin develop --release

# Build wheel for distribution
maturin build --release

Install Pre-built Wheel

# From the rust directory after building
pip install target/wheels/victor_native-*.whl

Usage

The native extensions are automatically used when available:

from victor.processing.native import (
    rolling_hash_blocks,
    batch_cosine_similarity,
    repair_json,
    compute_signature,
    is_native_available,
)

# Check if native extensions are loaded
print(f"Native available: {is_native_available()}")

# Deduplication
blocks = rolling_hash_blocks(content, min_block_length=50)
for hash_str, block, is_duplicate in blocks:
    if is_duplicate:
        print(f"Duplicate block: {block[:50]}...")

# Similarity
query = [0.1, 0.2, ...]  # 384-dim embedding
corpus = [[...], [...], ...]  # List of embeddings
similarities = batch_cosine_similarity(query, corpus)

# JSON repair
fixed = repair_json("{'key': 'value', 'active': True}")
# '{"key": "value", "active": true}'

# Signature hashing
sig = compute_signature("read_file", {"path": "/test.py"})

Fallback Behavior

If the native extension is not available (not installed or incompatible platform), the victor.processing.native module automatically falls back to pure Python implementations with equivalent functionality.

from victor.processing.native import is_native_available

if is_native_available():
    print("Using Rust implementation (fast)")
else:
    print("Using Python fallback (compatible)")

Architecture

rust/
├── Cargo.toml          # Workspace configuration and shared version
├── pyproject.toml      # maturin build configuration
├── README.md           # This file
└── crates/
    ├── protocol/
    ├── state/
    ├── tools/
    ├── edge-runtime/
    └── python-bindings/

Releasing crates.io packages

Rust workspace releases use their own rust-vX.Y.Z tags. Before tagging, update the workspace version and every internal dependency version in the crate manifests, then run:

cd rust
cargo fmt --all --check
cargo test --workspace --locked
cargo package -p victor-protocol --locked
cargo package -p victor-state --locked
cargo package -p victor-tools --locked
cargo package -p victor-edge --locked

All four package checks resolve the internal Victor dependencies through crates.io, providing the same consumer-side validation used by the release workflow.

Push an annotated rust-vX.Y.Z tag only after the release commit reaches main. The Publish Rust crates workflow validates that the tag and workspace versions match, then publishes the dependency chain. It requires the Actions secret CARGO_REGISTRY_TOKEN to be available to the repository. Re-running the workflow is safe: crate versions already present on crates.io are skipped and verified. After publication, the workflow installs victor-edge back from crates.io and runs its version command.

Testing

# Run Rust tests
cargo test

# Run Python integration tests
pytest ../tests/unit/test_native.py -v

License

Apache License 2.0

Release files for victor-native 0.8.1

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

Built distributions (wheels)

Table of built distributions (wheels) for victor-native 0.8.1
File
victor_native-0.8.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
victor_native-0.8.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
victor_native-0.8.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
victor_native-0.8.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
victor_native-0.8.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
victor_native-0.8.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
victor_native-0.8.1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details
victor_native-0.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
victor_native-0.8.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details

Total release size: 12.7 MB

Release files / victor_native-0.8.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL victor_native-0.8.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bc63404121da958912eb97395a587ae771c6c74158fedac0e540cfb6212e7031
BLAKE2b-256 checksum
How to use checksums
c3facca379ea4aa83fbf7e6bb52e546cc67215fc8e865122dca8a7bf91781208
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL victor_native-0.8.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
66eb374f78f645f6eb596a9f98c6234ef7e943c258454c9f4f7c3e5af43b283d
BLAKE2b-256 checksum
How to use checksums
9a645c4910699f9b6817612ab64e25dafe5602591f492364b881ae62e2b11720
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp312-cp312-win_amd64.whl

Download URL victor_native-0.8.1-cp312-cp312-win_amd64.whl
Size 1.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f36609f5483b8c2c611ebeb0f7dbe444da3d0d294bc693ff66413648c0035810
BLAKE2b-256 checksum
How to use checksums
df7bed432e4453a95aaa462353d9a9da04e4742574bdf6c1dc9e20bec27e99ab
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL victor_native-0.8.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
89e58cbeb1f4dfdb1610236cfd9482ad9d3f5d3124ad35e35b399912dcbdd0bb
BLAKE2b-256 checksum
How to use checksums
d283bb3b9e44db7b050804c7e65faa6aaa0e305da87a413a7372f87470a5194a
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL victor_native-0.8.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
631ad5c7068753c28707bff127c1c7690168f54bb319d9212a59c136e1623cfb
BLAKE2b-256 checksum
How to use checksums
fa902a934d1d75fcce4d3346b69bc58113ebbf3ec8e53cbe7bb6d25bc23a8013
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL victor_native-0.8.1-cp312-cp312-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4fbd7a0088725b3473a0005678f53a0ab34bf23d3a526a0a63273e94a496cde2
BLAKE2b-256 checksum
How to use checksums
19b1194f8b9e325682fc92492f58e9e458edf7ae3a45c5dfb5a7476cb37fdb47
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL victor_native-0.8.1-cp312-cp312-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
745fb6b43a63e8ca0792a53dc8673c38557ecd360990b73816f08fe685abdff3
BLAKE2b-256 checksum
How to use checksums
6faa8356a2b4a721ebae9b80b798d6d1c2ca24a8e1d9e81b70e40aa0b98e4ffa
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL victor_native-0.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
29f43cedafa622bdc0b44f4624cb1f62fa0e6c09c34647c73c9925cacfcb1c05
BLAKE2b-256 checksum
How to use checksums
595b706e18aa332fdcc7a32cd77c1ef771ce2f7d03822c369703d5d6302842eb
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 16, 2026.

Transparency log

Release files / victor_native-0.8.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL victor_native-0.8.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c99fa91db8b96bf5f7f6b65a96b8683757c41ef1ffcf8f6bb703449438ad13f7
BLAKE2b-256 checksum
How to use checksums
46f52a5147ea714d05819d56cb0c1df7f8972bd78e34bd30d137fb7d5872d12a
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.2

7 release files

This release

0.8.1 This release

9 release files

0.8.0

9 release files

0.1.0

9 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