Metadata-Version: 2.4
Name: baseten-loops-tinker
Version: 0.2.0
Summary: Drop-in tinker compatibility shim backed by the loops SDK
Requires-Python: >=3.12
Requires-Dist: baseten-loops>=0.1.0
Description-Content-Type: text/markdown

# loops-tinker

Drop-in compatibility shim that provides the `tinker` package namespace backed
by the `loops` SDK.

## Installation

```bash
pip install loops-tinker
```

## Usage

Existing code that uses `import tinker` works without modification:

```python
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`:

```python
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`:

```toml
[tool.uv]
override-dependencies = [
    "tinker ; python_version < '0'",
]
```

Then add the dependencies:

```bash
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.
