loops-tinker
Drop-in compatibility shim that provides the tinker package namespace backed
by the loops SDK.
Installation
pip install loops-tinker
Usage
Existing code that uses import tinker works without modification:
import tinker
service_client = tinker.ServiceClient(training_project_id="proj_abc123")
training_client = service_client.create_lora_training_client(
base_model="Qwen/Qwen3-8B", rank=16,
)
sampling_client = service_client.create_sampling_client(model="Qwen/Qwen3-8B")
All types are also available under tinker.types:
from tinker.types import SamplingParams, Datum, ModelInput
from tinker.types.tensor_data import TensorData
Using with tinker-cookbook
tinker-cookbook depends on tinker, but you can swap in loops-tinker using
uv's override-dependencies to prevent the original tinker from being installed.
First add the override to pyproject.toml before installing any dependencies
(there is no CLI command for this). If tinker-cookbook is added first, the
original tinker gets installed and its files conflict with loops-tinker:
[tool.uv]
override-dependencies = [
"tinker ; python_version < '0'",
]
Then add the dependencies:
uv init
uv add tinker-cookbook
uv add "loops @ git+https://github.com/basetenlabs/loops#subdirectory=loops"
uv add "loops-tinker @ git+https://github.com/basetenlabs/loops#subdirectory=loops-tinker"
loops is a transitive dep of loops-tinker but must be listed directly
because [tool.uv.sources] only applies to direct dependencies. This won't
be needed once loops is published to PyPI.
The tinker namespace will be provided by loops-tinker instead of the
original package.
Token provenance
Enable recording when creating the sampling client, as in Tinker:
sampling_client = training_client.save_weights_and_get_sampling_client(
record_stability_info=True,
)
response = await sampling_client.sample_async(
prompt=prompt,
num_samples=1,
sampling_params=sampling_params,
include_routed_experts=True,
)
sequence_id = response.sequences[0].sequence_id
record_stability_info defaults to False. Both sync and async versions of
ServiceClient.create_sampling_client, TrainingClient.create_sampling_client,
and TrainingClient.save_weights_and_get_sampling_client accept it. Every sample
from that client records data; there is no per-sample recording option.
Attach PromptProvenanceSpan and SampledProvenanceSpan references with
Datum.with_provenance(model_input=..., loss_fn_inputs=...). The two lists tile
the input tokens and target-token rows respectively. Token data stays on the
server; the client passes only sequence references and spans.
Paired clients share the trainer's run and session. Standalone clients record
under their service session; trainers in that same session can consume those
references. The sampler must support route capture and the trainer must enable
R3 replay. include_routed_experts=True requests the route payload; it is a
Loops extension. The recording interface matches Tinker, but StableReinforce
and top-k recording are not implemented.
Retention differs from Tinker: Loops stores generic sampling records and payloads in S3 or Cannery without implementing Tinker's inactivity expiry. Retention is controlled by storage lifecycle policies, not the client session lifetime. These records support R3; they are not StableReinforce stability artifacts.
Training references use Datum.with_provenance(...) exclusively. Route payload
locations are stored in sequence records, not returned on SampledSequence.
include_routed_experts=True requires a client created with
record_stability_info=True; it selects the moe.routes payload for that record.
Recording uses the existing service session, independently of sampler affinity. See the native SDK provenance requirements for the server versions provenance needs.
Metadata
Release files for baseten-loops-tinker 0.19.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| baseten_loops_tinker-0.19.0.tar.gz | 92.2 kB | With provenance | Details for baseten_loops_tinker-0.19.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| baseten_loops_tinker-0.19.0-py3-none-any.whl | Python 3 | none | any | Details for baseten_loops_tinker-0.19.0-py3-none-any.whl |
Total release size: 105.1 kB
Release files / baseten_loops_tinker-0.19.0.tar.gz
| Download URL | baseten_loops_tinker-0.19.0.tar.gz |
|---|---|
| Size | 92.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
485ee2b59bfb5b9000c9260089e6e095d69f7cdb40cac869b1eda8d89170acc7
|
|
BLAKE2b-256 checksum How to use checksums |
b5c86af1329d82677cc88546027a9c54a6d6e459eb67c7b000a5e8ead7de07a7
|
| 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 12, 2026.
Transparency logRelease files / baseten_loops_tinker-0.19.0-py3-none-any.whl
| Download URL | baseten_loops_tinker-0.19.0-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60179e005290d5bec893548e1296627e546ff0372bd85f225109dd9136da1209
|
|
BLAKE2b-256 checksum How to use checksums |
7229040133ee4de29b57cb4298174961a7b86660e1976b345e1df664a4c86aa5
|
| 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 12, 2026.
Transparency logSecurity for baseten-loops-tinker 0.19.0
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.
Attestation for baseten_loops_tinker-0.19.0.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 12, 2026.
Transparency logA 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.