Getting started Quickstart

Quickstart

Make your first call, fine-tune an open-weight model on your own examples and deploy it behind an OpenAI-compatible endpoint, in about 15 minutes.

Get an API key

Create a key in the Console, then store it as an environment variable. Keys are secret: keep them out of source control and client-side code.

Terminal
export RSI_API_KEY="your-api-key"

Install the SDK

The Python SDK covers training, sampling and deployments. For inference you can also use the OpenAI SDK you already have.

pip install rsi openai

Package names, hosts and environment variables such as rsi and RSI_API_KEY are placeholders until the SDK ships.

Make your first call

Every model is served through an OpenAI-compatible API. Point your client at https://api.rsi-labs.ai/v1 and pick a model from Models and pricing.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.rsi-labs.ai/v1",
    api_key=os.environ["RSI_API_KEY"],
)
resp = client.chat.completions.create(
    model="Qwen3.8-27B",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Fine-tune a model

Open a training session, create a model with a LoRA adapter and train it on batches of your examples. train_step runs the forward pass, backward pass and optimizer update together.

Each example is a chat conversation in the same format as the API. See Your first SFT run for data preparation.

train.py
import os
import rsi

client = rsi.Client(api_key=os.environ["RSI_API_KEY"])

with client.session() as session:
    model = session.create_model(
        base_model="Qwen3.6-35B",
        lora=rsi.LoraConfig(rank=16),
    )
    for batch in batches:
        model.train_step(batch, lr=1e-4, loss_fn="cross_entropy")
    checkpoint = model.save_weights("support-v1", mode="inference")

Deploy your model

Turn the saved checkpoint into a dedicated deployment. With wait=True the call returns once the endpoint is ready.

deploy.py
deployment = client.create_deployment(
    checkpoint=checkpoint,
    unified_replicas=1,
    wait=True,
)
print(deployment.base_url, deployment.model)

Call your model

Your deployment speaks the same API as before, so switching an app over is a one-line change to the base URL and model name.

serve.py
inference = OpenAI(
    base_url=deployment.base_url,
    api_key=os.environ["RSI_API_KEY"],
)
resp = inference.chat.completions.create(
    model=deployment.model,
    messages=[{"role": "user", "content": "Where is my order?"}],
)

Next steps