Skip to main content

this_file: README.md

Uubed Python

Shared model inference, compact embedding records and English-source translation memory for book alignment and localization.

Translation memory

Install this checkout together with its native uubed-rs wheel. The [tm] extra requires that distribution; add [inference] for local embedding models. See the workspace setup for editable installs before publication.

from pathlib import Path
from uubed.embeddings import Embedder
from uubed.memory import TranslationMemory, build_memory

engine = Embedder("jina", dimensions=256, device="cpu")
try:
    build_memory([Path("translations.tmx")], Path("localization.sqlite"), engine)
    with TranslationMemory("localization.sqlite", embedder=engine) as memory:
        exact = memory.exact("Bold", "pl")
        references = memory.lookup("Make the font bold", "pl", top_k=5)
finally:
    engine.close()

The importer streams TMX, finds English by language tag, and embeds each distinct source once. SQLite stores all target variants and path/unit provenance, including conflicting translations. Exact lookup preserves case and whitespace and loads no model. Semantic lookup filters by target language and returns bounded cosine-ranked pairs. Model/weights/task/prefix/truncation/dimension mismatches are rejected. The index uses ordinary SQLite and signed int8 vectors, without a vector extension. At 256 dimensions, each vector payload occupies 256 bytes; texts and metadata add storage. Build into a new filename to change inputs or model settings.

uubed tm build translations.tmx --output localization.sqlite --model jina --dimensions 256
uubed tm lookup localization.sqlite 'Bold' --language pl --exact-only
uubed tm lookup localization.sqlite 'Make the font bold' --language pl

For a GGUF-backed index, pass --backend llama.cpp --model-path /path/to/model.gguf at build time and the matching --model-path at semantic lookup time. The index can move independently of the weight file.

Book embeddings

EMBEDDINGS.md describes the shared Embedder, verified model profiles, resident runtimes, Matryoshka truncation and UB1 int8/int4/binary records. Vexy Paraltext uses these APIs for its book alignment workflow and TMX output. TM indexing uses the same inference and signed int8 quantization code.

Byte codecs

The existing encode/decode APIs retain eq64, shq64, t8q64, zoq64, and mq64. They encode bytes and are separate from model-aware signed UB1 vectors. The optional native module is named uubed_native; Python fallbacks remain available for byte encoding. A textual lossless encoding expands bytes; it is not an embedding compression algorithm.

from uubed import encode, decode
encoded = encode(bytes(range(256)), method="eq64")
decoded = decode(encoded, method="eq64")

Development

../../test.sh builds the actual native wheel, installs it into the test environment, and verifies this package and both consumers. uvx hatch test -py 3.12 runs this package's suite when its native TM dependency is installed. Build distributions with uv build. MIT license.

Releases and local data

./publish.sh --dry-run verifies the next release without pushing or uploading. ./publish.sh commits, tags and publishes it. See RELEASING.md for credentials, same-tag retries, dependency order and private-data exclusions.

Metadata

Release files for uubed 1.0.7

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

Source distribution (sdist)

Source distribution for uubed 1.0.7
File Size Uploaded Provenance Actions
uubed-1.0.7.tar.gz 143.5 kB With provenance Details for uubed-1.0.7.tar.gz

Built distribution (wheel)

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

Total release size: 264.8 kB

Release files / uubed-1.0.7.tar.gz

Download URL uubed-1.0.7.tar.gz
Size 143.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b3101579b5b12eb30af916bfe9fb24be17890378f89190b81fd09d7c70e22690
BLAKE2b-256 checksum
How to use checksums
d88329bbc24d9808c05b4089d74a838cd09e1825e08362e644e27fda4fcfbde8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / uubed-1.0.7-py3-none-any.whl

Download URL uubed-1.0.7-py3-none-any.whl
Size 121.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e67bc8084afacc5aa1e1085edbe034a1d6a0ea9a05d094e4d8ee375905df6703
BLAKE2b-256 checksum
How to use checksums
e900f7579e137c923595b3d7de89b1ef58d06426ae8cfc42acfea8a1f13a8a46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for uubed 1.0.7

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for uubed-1.0.7.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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