Registry / ai-ml / truss-transfer

truss-transfer

JSON →
library0.0.43pypypi✓ verified 86d ago

Truss-transfer is a Python-optional download utility library for resolving Baseten Pointers (bptr), designed to speed up file transfers within the Baseten ecosystem. It is primarily used internally by the `truss` CLI for serving AI/ML models in production. The current stable version is 0.0.41, with frequent releases often coinciding with updates to the main `truss` library.

pip install truss-transfer
INSTALL
IMPORT
SIG · TRUSS-TRANSFER
T
truss-transfer
ai-mlpythonv0.0.43
Install
1.9s avg
Import
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.43 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 29.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.9s · import 0.000s · 30MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

truss_transfer
import truss_transfer
PyModelRepo
from truss_transfer import PyModelRepo
Used for defining model repositories for Baseten Pointers.

This quickstart demonstrates how to define `PyModelRepo` objects, which are central to `truss-transfer`'s functionality. These objects specify how to fetch model artifacts from sources like Hugging Face or Google Cloud Storage, often managed as Baseten Pointers (bptr) for deployment with the main `truss` library.

import truss_transfer import os # Example: Define a Hugging Face model repository using PyModelRepo # For actual use, 'hf_access_token' would be an environment variable or Baseten secret. # Replace 'your-hf-model' with an actual model ID and 'main' with a valid revision. hf_model_repo = truss_transfer.PyModelRepo( repo_id=os.environ.get('HF_MODEL_ID', 'microsoft/DialoGPT-medium'), revision=os.environ.get('HF_MODEL_REVISION', 'main'), volume_folder='dialogpt_model_cache', runtime_secret_name='hf_access_token' ) print(f"Defined Hugging Face model repository: {hf_model_repo.repo_id}") # Example: Define a GCS model repository # 'gcs-service-account-jsn' would be a Baseten secret containing GCS service account JSON. gcs_model_repo = truss_transfer.PyModelRepo( repo_id=os.environ.get('GCS_BUCKET_PATH', 'gs://my-bucket/my-model/'), revision='', volume_folder='gcs_model_cache', runtime_secret_name='gcs-service-account-jsn', kind='gcs' ) print(f"Defined GCS model repository: {gcs_model_repo.repo_id}") # In a typical Truss deployment, these PyModelRepo objects are often used # within a `config.yaml` or a `model.py` for model loading and data transfer. # This example primarily shows how to instantiate the objects.
Debug
Known issues
gotchaDirect standalone usage of `truss-transfer` is uncommon for end-users. It is primarily an internal dependency and utility for the `truss` CLI and Baseten platform. Attempting to use it outside this context without a clear understanding of Baseten Pointers (bptr) and `truss` deployment mechanisms may not yield expected results.
fix
Focus on using the main `truss` CLI for model deployment. `truss-transfer`'s functionality is integrated into `truss`'s model serving and data transfer processes. Consult Baseten's official `truss` documentation for model deployment workflows.
affects: All versions
gotchaThe package name on PyPI is `truss-transfer`, but the primary import is `truss_transfer` (with an underscore). Mismatched naming conventions between PyPI and import statements are a common source of `ModuleNotFoundError`.
fix
Always use `import truss_transfer` in Python code after `pip install truss-transfer`.
affects: All versions
breakingSince `truss-transfer` is frequently updated and tightly coupled with the `truss` library and Baseten platform, new versions might introduce subtle changes in `PyModelRepo` parameters or expected behavior without explicit major version bumps. This is particularly relevant when `truss-transfer` is bundled with `truss`.
fix
When `truss-transfer` is a direct dependency in a `truss` project, ensure `truss` and `truss-transfer` versions are compatible. Refer to the Baseten `truss` documentation and release notes for any specific version requirements or migration guides. Regularly update both `truss` and `truss-transfer` to their latest stable versions.
affects: 0.0.x series
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'truss-transfer'
The Python import statement uses a hyphen, which is invalid for module names. The PyPI package name `truss-transfer` is installed, but the corresponding importable module uses an underscore.
fix
Change the import statement to use an underscore: `import truss_transfer`.
TypeError: PyModelRepo.__init__() got an unexpected keyword argument 'unsupported_arg'
The `PyModelRepo` class constructor arguments have changed or an unrecognized argument is being passed. This often happens with minor version updates due to the library's active development.
fix
Consult the latest `truss-transfer` or Baseten `truss` documentation (specifically `PyModelRepo` usage) for the correct set of parameters. Remove or update the offending keyword argument.
FileNotFoundError: [Errno 2] No such file or directory: 'bptr://...' when deploying a Truss model
The Baseten Pointer (bptr) specified in the `PyModelRepo` or `config.yaml` cannot be resolved or accessed by `truss-transfer`. This can be due to incorrect `repo_id`, missing credentials (e.g., `runtime_secret_name` not configured on Baseten), or network issues.
fix
Verify the `repo_id` is correct and accessible from the Baseten environment. Ensure that any specified `runtime_secret_name` (e.g., `hf_access_token`, `gcs-service-account-jsn`) is correctly configured and available within your Baseten workspace. Check network connectivity if deploying to a custom environment.
Upgrade
Version history
0.0.43latest on PyPI · released Jun 3, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources