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

# Bring your own model

> Upload a LoRA adapter, then call it.

## Adapter

| | |
| - | - |
| Files | `adapter_model.safetensors` (2 GiB max), `adapter_config.json` (256 KiB max). No other file, pickle or code. |
| Type | LoRA |
| Rank | 64 max |
| `target_modules` | In the base |
| Tensors | F32, F16 or BF16. Served in BF16: a BF16 file is the same numbers at half the size. |
| Base | `base_model_name_or_path`; `revision` unset or pinned |

## Bases

Only bases that serve 262,144 tokens.

| `base` |
| - |
| `qwen3.8-27b` |
| `qwen3.8-flash-next` |
| `qwen3.6-35b-a3b` |
| `qwen3.5-9b` |
| `qwen3.5-4b` |
| `gemma-4-31b-it` |
| `gemma-4-12b-it` |
| `qwen3.5-122b-a10b` |
| `nemotron-3.5-super-vl` |

Repository, pinned revision, current list: `GET /llm/uploaded-models/bases`.

## Upload

Owner, admin, or [API key](https://docs.os3compute.com/keys.md#api-key-permissions) with Models and Owner and admin steps. Card or credit required.

```python wrap theme={null}
import base64
import os

import requests

API = "https://api.os3compute.com/llm/uploaded-models"
KEY = {"Authorization": f"Bearer {os.environ['OS3_API_KEY']}"}


def post(path, body=None):
    r = requests.post(API + path, headers=KEY, json=body)
    r.raise_for_status()
    return r.json()


def put(url, data, headers=None):
    requests.put(url, data=data, headers=headers).raise_for_status()


# workspace_id: GET /workspaces
# rights: "I have the right to use and host these weights."
upload = post("", {"workspace_id": "<workspace id>", "name": "support-v1",
                   "base": "qwen3.8-27b", "rights": {"accepted": True, "version": "v1"}})
for name in ("adapter_model.safetensors", "adapter_config.json"):
    def link():  # links expire: a new one for each block
        return post(f"/{upload['id']}/links", {"file": name})

    size, ids = link()["block_bytes"], []
    with open(name, "rb") as f:
        while block := f.read(size):
            ids.append(base64.b64encode(b"%06d" % len(ids)).decode())
            put(f"{link()['url']}&comp=block&blockid={ids[-1]}", block)
    order = "".join(f"<Latest>{i}</Latest>" for i in ids)
    put(f"{link()['url']}&comp=blocklist",
        f"<?xml version='1.0' encoding='utf-8'?><BlockList>{order}</BlockList>",
        {"Content-Type": "application/xml"})
print(post(f"/{upload['id']}/seal")["state"])  # checking
```

Up to 3 uploads open (uploading, checking, in review), 10 new in 24 hours, 20 served at once. 24 hours to seal. Links last 15 minutes.

## Import

Instead of the links and the seal, `POST /llm/uploaded-models/{id}/import`. From Hugging Face:

```json wrap theme={null}
{"source": {"kind": "huggingface", "repo": "<owner>/<name>"}}
```

Optional in `source`: `revision` (default `main`), `subfolder`, `token` (private or gated repository; never stored).

From S3 (`s3`) or GCS (`gcs`): a pre-signed or public https link to each file, on the bucket's regional address (`<bucket>.s3.<region>.amazonaws.com`, `storage.googleapis.com/<bucket>`); never stored.

```json wrap theme={null}
{"source": {"kind": "s3", "weights_url": "<link>", "config_url": "<link>"}}
```

While copying, send the same body again after `Retry-After`. Then `checking`.

## States

`GET /llm/uploaded-models/{id}`:

| `state` | Means |
| - | - |
| `uploading` | `GET …/{id}/progress`: blocks stored. |
| `checking` | Automatic check. |
| `refused` | Check failed: `refusal.message`. |
| `in_review` | OS3 reviews. |
| `sent_back` | Review failed: `sent_back_reason`. |
| `live` | Serves calls. |
| `paused` | Calls refused. `POST …/{id}/pause`, `…/{id}/resume`. |
| `removed` | `DELETE …/{id}`. |
| `expired` | Not sealed in time. |

## Call and price

With its workspace's [gateway key](https://docs.os3compute.com/keys.md):

```json wrap theme={null}
{"model": "uploaded/<name>", "messages": [{"role": "user", "content": "Hello"}]}
```

[Adapter pricing](https://docs.os3compute.com/pricing.md#uploaded-adapters) · [Limits](https://docs.os3compute.com/errors.md#limits)

## Request a base

`POST /llm/base-requests`: `model_name`, `why`, `link`, `expected_traffic`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.