Open as Markdown

Core concepts

organization
├─ continuous models   each learns by itself on one base model: "tickets"
│  └─ versions         v1, v2, ...: the one in production is "tickets", a newer one waiting "tickets:preview"
└─ custom projects     models you train with the SDK, "router-2"
   └─ for training them: datasets, runs and evaluations

Organization

An organization owns all resources. An API key (edk_...) belongs to one organization. Create keys in the dashboard.

Continuous model

A continuous model answers your decisions and learns by itself from them; feedback on them is optional. It has one base model, from the catalog, chosen when you create it. The base model never changes. See Continuous models.

import endor

client = endor.EndorClient()
project = client.projects.create("tickets", base_model="mapika/decider-2b")

Versions

A continuous model gets better in versions: v1, v2, and so on. Two of them can be called:

modelAnswers with
ticketsThe production version. Before the first version, the base model.
tickets:previewThe preview: the newest version, while it isn't in production (with auto-promote off). Otherwise 404 no_preview.

With auto-promote on (the default for a new continuous model), each new version goes to production at once. Turn it off and a new version waits as the preview until you promote it. You can promote any version to production, and promoting an older one is a rollback. See Production and preview.

Names

Continuous models and the models of custom projects share one list of names in an organization, so a continuous model and a saved model can't have the same name. Names use lowercase letters, digits, ., _ and - (63 characters maximum), and can't be a base model's name (the part of its id after owner/). : separates a continuous model from its version, as in tickets:preview.

Base model

A base model is an open decision model from the catalog. Its id is owner/model, as on Hugging Face: mapika/decider-2b. You choose one when you create a continuous model or a custom project, or call it directly with its id as model.

Contract

Each base model has a contract: how Endor turns the state and a question into the model's input, and how it reads the probabilities. The contract decides which parts of a question the model reads, so the same question can need other wording on another base model. For example, this yes/no question puts its meaning in a true description:

{"type": "noul", "instructions": "Is it urgent?", "criteria": {"true": "The customer needs an answer today"}}

mapika/decider-2b reads the description. autotrust/gev-26b reads a noul from its instructions only, so there the question fails with 422 invalid_options. Written as {"type": "noul", "instructions": "Does the customer need an answer today?"}, it works on both. See Rules for each base model.

Custom project

In a custom project, you train a model yourself with the SDK: a LoRA adapter on a base model, saved under a name. A saved model is archived: you can download and evaluate it, but decisions can't call it. Promote it to production to call it by its name, for example router-2. An organization can have 3 models from custom projects in production; ask for more. Each save is a new model. See Custom projects.

Dataset

A dataset is a named list of decision rows, 50,000 rows maximum, for evaluating your trained models and base models. You cannot change a dataset. To change the data, upload a new dataset with a different name.

Training calls do not use datasets: they send the data in the request.

Run

A run trains a custom project's model on one base model, on a GPU that it shares with other runs of that base model. Each call of a run runs alone. You send training calls to the run (see Custom projects).

StatusMeaning
provisioningThe run waits for a GPU and loads. On a GPU that runs the base model already, this takes seconds; when a GPU has to start, a few minutes.
readyThe run is on a GPU and accepts training calls.
idleNo calls for 2 minutes. Endor saved the state and freed the GPU. The next call resumes the run in seconds.
closingThe run accepts no new calls. Accepted calls finish.
closedThe run is done. Saved models stay.
failedThe GPU stopped. failure gives the cause.

Evaluation

An evaluation scores a model from a custom project (in production or archived) or a base model on a dataset, or on rows sent with the call. It gives accuracy, NLL, Brier score, ECE, mean confidence and selective accuracy: for all questions, for each question type and for each question. Rows without labels are answered, not scored.

  • client.evaluations.create(model, dataset) (or rows=...) runs on the server. Endor bills it as decisions.
  • client.predict(model, rows) is an evaluation of rows without labels: it returns the answers for each row, in order.
  • run.log_eval(model, results, step=..., name=...) records results that you calculated. It is free.

Future

Slow operations return a future immediately: run start, forward, forward_backward, optim_step, save_checkpoint and server evaluations. The status of a future is pending, running, completed, failed or cancelled.

Call .result() to wait for one future. Call endor.gather(...) to wait for many futures. In a training loop, endor.Steps sends the next step before you read the results of the last one (see Custom projects).