> ## 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.

# Modal Cloud Backend

> Deploy CLaaS to Modal for remote GPU training on L40S

# Modal Cloud Backend

<Note>
  The Modal backend is **coming soon**. The configuration and deployment instructions below reflect the planned design.
</Note>

The Modal backend runs SDPO distillation remotely on [Modal](https://modal.com/) using L40S GPUs. No local GPU is needed. Modal handles all infrastructure.

<Warning>
  Modal manages the compute infrastructure. You do **not** use Docker Compose for this backend. Deployment is handled entirely via the Modal CLI.
</Warning>

## Requirements

* Python 3.11+ and [uv](https://docs.astral.sh/uv/)
* A [Modal](https://modal.com/) account
* `HF_TOKEN` (optional, for gated models)

## Deployment

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

  <Step title="Authenticate with Modal">
    ```bash theme={null}
    uv run modal token new
    ```
  </Step>

  <Step title="Deploy">
    ```bash theme={null}
    export HF_TOKEN=...   # optional, for gated models
    export CLAAS_BASE_MODEL_ID=Qwen/Qwen3-8B
    uv run modal deploy -m claas.deploy
    ```

    The deployed app exposes the same API at `https://your-app--claas-distill-fastapi-app.modal.run`.
  </Step>

  <Step title="Verify">
    ```bash theme={null}
    curl https://your-app--claas-distill-fastapi-app.modal.run/
    curl https://your-app--claas-distill-fastapi-app.modal.run/v1/lora
    ```
  </Step>
</Steps>

## Configuration

| Variable              | Required | Default         | Description                           |
| --------------------- | -------- | --------------- | ------------------------------------- |
| `HF_TOKEN`            | No       | —               | HuggingFace token (gated models only) |
| `CLAAS_BASE_MODEL_ID` | No       | `Qwen/Qwen3-8B` | Base model for LoRA training          |

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

## LoRA Storage

LoRAs are stored in the `claas-loras` Modal Volume, which persists across deployments. The volume is automatically created on first deploy.

## Claude Code integration

If you use [Claude Code](https://claude.ai/claude-code), the `/setup-modal` slash command deploys the CLaaS distillation service to Modal automatically.
