Python

UForm for Python

pip install uform 4.0.0-rc.1 · 3ee5e534

Every verb is a batch over buffer-protocol inputs, and every output whose length the call decides lands in an arena you reuse.

  • uform.Model encodes text, images, video and audio into pooled embeddings, per-token states and token vectors, and scores calibrated choices over texts.
  • uform.Trainer trains one on GPUs, joined across hosts by a uform.Mesh.
  • uform.Executor owns the threads or streams every call runs on, apart from any model.

Topics

Installation1The wheels carry the CPU library.
Quickstart
Receivers and Deferred Calls15A receiver carries what every C argument structure puts before its inputs: the executor and the completion.
Executors39uform.Executor.forram(threads=0, , memorydomains=None, cpuclass=None) creates an executor of host threads, and uform.Executor.forvram(devices=None, , scratchlimit=0, gpuclass=None) opens one stream per device.
Arenas7Every output whose length only the call knows, the embeddings, the states and their offsets, lands in a uform.Arena you pass, and the verb answers views over it without copying.
Encoding20
Choices4
Models24uform.Model.loadram(path) and uform.Model.loadvram(path, devices=[0]) copy a safetensors checkpoint into host memory or onto GPUs, and loadrambuffer and loadvrambuffer take the checkpoint's bytes instead.
Training98Training is GPU-only.
Errors16
Design