Open as Markdown

Continuous models

A continuous model learns by itself from the decisions you send it. That is all it needs: Endor has a frontier model answer a share of them and trains new versions from those answers. When you later learn the right answer to a decision, from a review or an outcome, you can also send it as feedback. That is optional, a way to push the model further. Each new version goes to production as soon as it is ready (auto-promote), or you turn auto-promote off and promote versions yourself. You do not upload data or train.

In the SDK and the API, continuous models are projects: client.projects, /v1/projects.

Create a continuous model

A continuous model has one base model, chosen when you create it. You cannot change it later.

import endor

client = endor.EndorClient()
project = client.projects.create("tickets", base_model="mapika/decider-2b", description="Route support tickets")
curl -X POST https://api.endor.thetokencompany.com/v1/projects \
  -H "Authorization: Bearer $ENDOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "tickets", "base_model": "mapika/decider-2b"}'

In the dashboard, click New continuous model. The base model list puts the one that fits its name and description first, marked Recommended. An organization can have 5 continuous models; email rasmus@thetokencompany.com for more.

Production and preview

Each continuous model works like a deployment, with two versions you can call:

modelAnswers with
ticketsThe production version. Call it from your app.
tickets:previewThe preview: the newest version, while it isn't in production. Use it to try a version before you promote it.

Before the first version, tickets answers with the base model. When the newest version is in production, there is no preview: tickets:preview fails with 404 no_preview. The response's model names the version that answered, for example tickets:v4, and that name can be called too while v4 is in production or the preview. It stops answering once another version replaces it, so to follow new versions, call tickets. Other versions can't be called: tickets:v3 fails with 404 version_not_callable. Promote a version to call it.

Auto-promote

Auto-promote is on for a new continuous model: each new version goes to production as soon as it exists, so there is no preview. A first version goes to production only once it answers better than the base model; until then it is the preview. Turn auto-promote off to keep each new version at tickets:preview until you promote it.

project.set_auto_promote(False)  # new versions go to preview only
project.set_auto_promote(True)   # the preview goes to production at once, and each new version after it

Over HTTP: PATCH /v1/projects/tickets with {"auto_promote": false}. In the dashboard, use the Auto-promote switch on its Settings tab.

Promote a version

Promote any version to put it in production. Promoting a version older than the newest is a rollback: it turns auto-promote off, so the version you chose stays in production until you promote another one or turn auto-promote on again.

for v in project.versions():  # newest first
    print(v.name, v.production, v.preview, v.accuracy)
project.promote("v3")  # "tickets" answers with v3 from now on

Over HTTP: POST /v1/projects/tickets/versions/v3/promote. In the dashboard, open a version's menu and click Promote to production.

Follow it

Its Models tab in the dashboard shows the production version (and the preview, when there is one), the progress toward the next version, and each version with its accuracy. The progress counts the distinct decisions it can learn from, so sending the same decision again doesn't move it. Over the API: GET /v1/projects/{project}/learning (project.learning() in the SDK) and GET /v1/projects/{project}/versions (project.versions()).

curl https://api.endor.thetokencompany.com/v1/projects/tickets/learning -H "Authorization: Bearer $ENDOR_API_KEY"

Keep decisions out of learning

Send exclude_from_training: true with a decision to keep it out of the continuous model's learning, for example when you run a benchmark against it. The decision is still answered, billed and logged.

client = endor.EndorClient(exclude_from_training=True)  # every decision of this client
res = client.system_one(state, questions, model="tickets", exclude_from_training=True)  # or one decision

Download a version

You can download any version's weights, a LoRA adapter for its base model: project.download("v3", "./v3"), or GET /v1/projects/{project}/versions/{version}/download. See Run a model outside Endor.

Optional: improve it with feedback

A continuous model doesn't need feedback to learn. When you find out whether a decision was right, for example when someone reviews it or you learn the outcome, you can tell Endor, and the continuous model learns from it in its next versions, including answers a frontier model wouldn't know. See Give feedback on decisions.

res = client.system_one(state, questions, model="tickets")
# later, once you know
client.corrections.create(res, {
    "department": {"correct": False, "answer": "technical"},  # wrong: the right answer
    "urgent": {"correct": True},                               # right
})

Price

All decisions of a continuous model cost the continuous-learning price of its base model: 1.5 × the decision price, also before the first version. The price includes the learning. See Base models. In usage rows, continuous_learning is true for these decisions.