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.

Release files for uubed 1.0.6

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.6
File Size Uploaded
uubed-1.0.6.tar.gz 130.6 kB Details

Built distribution (wheel)

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

Total release size: 244.0 kB

Release files / uubed-1.0.6.tar.gz

Download URL uubed-1.0.6.tar.gz
Size 130.6 kB
Tags Source
SHA-256 checksum
How to use checksums
28e6438d89d03ea1a62c8294ad28e15ee1348ade98182ac0024329ad87c9d683
BLAKE2b-256 checksum
How to use checksums
35059241bc01c36163c1ce8b5dd7dde4b10e58a83945b1e7ca664026e00c1f56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL uubed-1.0.6-py3-none-any.whl
Size 113.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d8720a0c21061ff780d0d2418ee748a7756778a9180bfef3897ec89fb339118
BLAKE2b-256 checksum
How to use checksums
7bdde8c851623a4b8b6db65510546fb9140ddac9a5b3966cd86007ab67fc911b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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