Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
Get started

Create your first adapter

Send examples of one task, follow its training, and compare a passing adapter version with your provider model.

Before you start. Complete the Quickstart. You need your Mubit key in MUBIT_API_KEY and provider access. This example sends 40 calls: they use your provider account or the starter credit, and passing is not guaranteed. Training must be on for your workspace: until it is, the console shows no Adapters page. To ask about it, see Get help.

1. Send examples of one task

Use the example below. It varies the support message while keeping the model and instructions the same as in the Quickstart.

Not every call becomes a kept example. By default, a task first trains at 25 kept examples; the count your console shows is the source of truth.

Create a virtual environment and install the SDK:

python3 -m venv .venv && source .venv/bin/activate
pip install openai

Save this as mubit-first-adapter.py:

mubit-first-adapter.py
import os
from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.mubit.ai/openai/v1",
    api_key=os.environ["MUBIT_API_KEY"],
)
 
instructions = (
    "Sort the support message into one category: "
    "billing, bug, account or other. Reply with the category only."
)
templates = [
    "I was charged twice for my {} plan this month.",
    "The {} dashboard shows an error when I export a report.",
    "How do I change the email address on my {} account?",
    "Can I get a refund for the {} plan I cancelled yesterday?",
    "The {} mobile app closes when I open settings.",
    "I can't reset the password for my {} account.",
    "Do you offer the {} plan to charities?",
    "Where can I download last month's invoice for the {} plan?",
]
plans = ["Starter", "Team", "Business", "Enterprise", "Education"]
 
# 8 messages x 5 plans: 40 calls of one task.
for template in templates:
    for plan in plans:
        response = client.chat.completions.create(
            model="gpt-6-luna",
            messages=[
                {"role": "system", "content": instructions},
                {"role": "user", "content": template.format(plan)},
            ],
        )
        print(response.choices[0].message.content)

Run it:

python mubit-first-adapter.py

2. Follow the task

Open Tasks and find the task created from these calls. Its name comes from the first words of the instructions. Watch its status, Collecting examples at first, and its kept-example count, such as 12 of 25 examples.

If it needs more examples, send new messages for the same task. When it has enough and can train, Mubit reviews the examples, trains an adapter version and tests it: the status reads Reviewing examples, Training, then Testing.

If progress stops, open the task and read the reason. Why a task is waiting or cannot train explains waits and failed training.

3. Check the result

Open Adapters, select the adapter, and open History. A Passed result makes that version available for comparison. Below target means its answers did not meet the required test result.

Read the result details before you decide what to add or change. A test result measures this version on its test cases; it does not guarantee every future answer. What each test result means lists every result and what to do.

4. Compare with your provider

For a passing version, select Compare with your provider. Try models opens with Side by side on. Enter only the message, as your app's users would write it: Try models adds the task's instructions. Then select Send to both.

Compare the provider model's reply, on the left, with your adapter's, on the right. Try models marks its calls not stored · trains nothing: they don't appear in Requests and don't train adapters. The first start of an adapter can take a few minutes.

If no version has passed, go back to What each test result means. If the adapter isn't in Try models, see Why an adapter is unavailable in Try models.

To follow your requests, tasks and adapters over time, open Overview in the console.

Results and recovery

What each test result means

Each version gets one test result: Passed, Below target, Malformed tool calls, Prompt only or Not tested. Select the adapter, then open History. Each version's row shows its test result:

ResultWhat it meansWhat to do
PassedThe version answers close enough to your provider model. On Overview, the adapter's line reads v1 passed its tests.Compare it in Try models.
Below targetThe version answers less like your provider model than it needs to. The line says by how much, such as Matched {a}% of your provider model's answers on {n} test cases · needs {need}%, or Passed {a}% of {n} required test cases · needs 100%.Send more calls of the task. See After a version that didn't pass.
Malformed tool callsSome of the version's tool calls were malformed: {k} of {n} tool calls were malformed · needs 0.Send more calls of the task.
Prompt onlyThe base model, the open model the adapter is built on, did as well as the adapter when given the task's prompt.A prompt-only version can't be tried in Try models. Send more calls of the task for a new version.
Not testedThe version has no test result. When Mubit gives a reason, it shows when you point at the result.Send more calls of the task for a new version.

While Mubit grades a version, the adapter's line reads Waiting for grading on {k} test cases. While the newest version is below its target, the adapter's card reads Not ready yet.

Why a task is waiting or cannot train

Waits

A task can wait before it trains. Point at its status on Tasks to see the wait, or open the task: its page says it in words.

WaitWhyWhat to do
Waiting: today's training limitToday's training limit is reached. It resets at 00:00 UTC.Nothing. Training starts after the reset.
Waiting: the pause between trainingsMubit pauses between two trainings.Nothing. Training starts after the pause.
Waiting for more examples: {k} of {need}The task has too few examples to keep some back as test cases.Send more calls with new messages.
Waiting for new examplesA training failed. Mubit tries again when new examples arrive. It does not retry the same ones.Send more calls with new messages.

Can't train

When a task's first training fails, its status reads Can't train, and the task's page reads No adapter yet: and the reason:

ReasonWhat to do
too few examples to train onSend more calls with new messages.
examples too long to train onSend calls with shorter requests and answers.
the training run failedSend more calls with new messages.
the first training stoppedSend more calls with new messages.

There is no button that retries a training. After a failed training, Mubit tries again only when new examples arrive, so recovery means sending new calls of the task.

After a version that didn't pass

Under a version that didn't pass, the adapter shows what happens next:

  • Next: a new version after {need} new examples: the task trains a new version once that many new examples arrive. Send more calls of the task.
  • Next: retraining paused: {reason}: the reason says why the task doesn't retrain now.

A version whose training failed reads Training failed.

Why an adapter is unavailable in Try models

Try models runs provider models on Mubit's key. Your organization has a number of Try models calls each day: the page shows how many are left, and the count resets at 00:00 UTC.

What you seeWhyWhat to do
No Compare with your provider on the adapterNo version of the adapter has passed its tests.Follow the task until a version passes. See What each test result means.
Not in Try models: prompt onlyThe version's result is Prompt only: the base model with the task's prompt did as well as the adapter.Send more calls of the task for a new version.
Not in Try models yetTry models can't run adapters in this workspace yet.Nothing to do in the console. To ask about it, see Get help.
Not in Try models: its base model isn't served hereTry models doesn't serve the base model this adapter is built on.Nothing to do in the console. To ask about it, see Get help.
Try models is offTry models is not switched on for this workspace.Nothing to do in the console. To ask about it, see Get help.
Your organization has used today's Try models calls. Try again after 00:00 UTC.Your organization has used its Try models calls for the day.Wait until 00:00 UTC.
Try models has reached today's limit for this workspace. Try again after 00:00 UTC.The workspace has reached its Try models limit for the day.Wait until 00:00 UTC.
Starting your adapter. The first try takes a few minutes. Keep this page open.The adapter is starting.Keep the page open: it sends your message again every 15 s, for up to 20 minutes.
Your adapter didn't start. Try again later, or choose a provider model.The adapter didn't start, or your organization has used its 3 adapter starts for this UTC day.Try again later, or choose a provider model.

Next

Understand tasks and sessions

What makes a task, and how to group a conversation's calls into one session.