> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openclaas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tinker SDK Backend

> Run CLaaS with Tinker's hosted inference and training - no GPU required

# Tinker SDK Backend

The Tinker backend uses Tinker's hosted inference and training APIs. **No local GPU is required.** Training runs against `Qwen/Qwen3-30B-A3B` via API credits.

## Requirements

* Docker and Docker Compose
* Python 3.11+ and [uv](https://docs.astral.sh/uv/)
* A Tinker API key from [tinker-console.thinkingmachines.ai/keys](https://tinker-console.thinkingmachines.ai/keys)
* A Telegram bot token from [@BotFather](https://t.me/BotFather)

## Installation

<Steps>
  <Step title="Clone and install">
    ```bash theme={null}
    git clone https://github.com/kfallah/CLaaS.git
    cd CLaaS
    uv sync --extra tinker
    ```
  </Step>

  <Step title="Configure environment">
    ```bash theme={null}
    cd docker
    cp .env.tinker.example .env.tinker
    ```

    Edit `.env.tinker` and set `TELEGRAM_BOT_TOKEN` and `TINKER_API_KEY`.
  </Step>

  <Step title="Start the stack">
    ```bash theme={null}
    docker compose -f docker-compose.tinker.yml --env-file .env.tinker up --build
    ```

    No model download needed. Inference and training happen remotely via Tinker.
  </Step>

  <Step title="Verify">
    ```bash theme={null}
    curl http://localhost:8000/v1/models
    curl http://localhost:8080/
    curl http://localhost:8080/v1/lora
    ```
  </Step>
</Steps>

## Services

| Service        | Port  | Description                                             |
| -------------- | ----- | ------------------------------------------------------- |
| `tinker-proxy` | 8000  | OpenAI-compatible proxy backed by Tinker SDK            |
| `claas-api`    | 8080  | CLaaS feedback API in Tinker execution mode             |
| `openclaw`     | 18789 | OpenClaw gateway with Telegram bot                      |
| `init`         | —     | One-shot: creates LoRA via API + writes OpenClaw config |

## Configuration

These variables are set in `.env.tinker`.

| Variable              | Required | Default              | Description                       |
| --------------------- | -------- | -------------------- | --------------------------------- |
| `TELEGRAM_BOT_TOKEN`  | Yes      | —                    | Bot token from @BotFather         |
| `TINKER_API_KEY`      | Yes      | —                    | Tinker SDK API key                |
| `MODEL`               | No       | `Qwen/Qwen3-30B-A3B` | Base model (must use Tinker name) |
| `FEEDBACK_BATCH_SIZE` | No       | `4`                  | Samples per batch before distill  |

For the full Hydra config and all environment variables, see the [Configuration Reference](/configuration).

## Known Gotchas

<Warning>
  **Tinker model naming**: Tinker uses its own model identifiers that differ from HuggingFace names. For example, the HuggingFace model `Qwen/Qwen3-Coder-30B-A3B-Instruct` is `Qwen/Qwen3-30B-A3B` in Tinker. Sampling works with either name, but **LoRA training init will reject the HuggingFace name** with a 400 error. Always use the Tinker name.
</Warning>

<Warning>
  **`CLAAS_TINKER_BASE_MODEL` must match `base_model`**: The proxy reads `CLAAS_TINKER_BASE_MODEL` to initialize its sampling client, and the eval config's `base_model` is passed to the API for LoRA init. If they reference different models, scoring and training will target different models.
</Warning>
