API compatibility
What the /v1 contract keeps stable, and what a restart does to a running analysis.
Kaimei API 1.3.1 serves the /v1 surface. GET /health reports the service version and api: "v1". The Python client 0.12.0 speaks this surface, models of any kind, text, generation and agents included. 1.3.0 adds to /v1, changes two answers and refuses one request that was answered wrongly before (an explanation of a table model by method: "occlusion", which held LIME's numbers under that name), so a client that works against the release before it keeps working unless it asked for that; versions has the details.
Kaimei API 1.2.0, the release before, made four changes in /v1. The Python client 0.11.0 speaks 1.2.0, confirming joining by email domain and agreeing to the Terms of Use at sign-up included. Clients 0.9.1 to 0.10.0 keep working: their calls have the same paths, fields and answers, apart from those four changes. The fourth means their auth.signup is refused, since they cannot send accept_terms.
Three of them changed behaviours in /v1 rather than under a new path, because each closed a way for one organization to act with another's access, or past its plan: turning on joining by email domain now mails the admin a link and answers enabled: false with pending until it is opened (settings turned on before stay on); a transfer removes the moved models' endpoint credentials and lists them in credentials_removed; and a transfer whose usage this month would take the destination past a monthly limit is refused with 403 quota_exceeded.
The fourth makes every account agree to the Terms of Use: sign-up without accept_terms: true is 400 terms_not_accepted, where before leaving it out made an account. A Google or GitHub sign-in that would make an account needs accept_terms=true on its start link, and resetting the password of an account that was never confirmed needs accept_terms: true. Signing in to an existing account needs nothing new.
- Additions are allowed. New fields, new optional parameters, new error codes and new endpoints can appear in
/v1. - Existing fields stay. A field that is already there keeps its name and its meaning. A rename, a removal, or a value whose meaning changed ships under a new path, not inside
/v1. - Errors keep one envelope.
{"error": {"type", "code", "message", "param"}}.codeandparamare left out when they do not apply. - Lists page the same way.
limitandoffset, and a page ofobject,data,total,limit,offset,has_more.
Starting the API applies any numbered database migration the database has not recorded. An analysis is a row: a restart resumes a job whose worker is gone, and after three interrupted attempts the job fails and can be started again. Rate limits are rows too, so every process of one deployment shares one window. Every response carries X-Request-Id. Send one made of letters, digits and ._:-, up to 64 characters, to keep your own; otherwise Kaimei assigns one.
A structure document includes verification: verified, unchecked (stored with no library check; it still runs), reupload (a client before 0.7.2 may have saved one tree of a forest as the whole model), drawn, builtin or schematic.
#Versions
| API | Python client | What it adds |
|---|---|---|
| 1.3.1 | 0.12.0 | The plan limits on models run by your own agent and on the size of model graphs also hold for graphs inside composites, weights uploaded again, and models forked or transferred in; an explanation of every input compares a row with different rows only. |
| 1.3.0 | 0.12.0 | Models of any kind as graphs of ONNX operators, and what a model is worked out from the model; text, token, sequence, tensor and audio inputs; the tasks text_generation, sequence_to_sequence, generation, embedding, multilabel_classification, object_detection, segmentation and clustering; generation; agents; the model profile. |
| 1.2.0 | 0.11.0 | Turning on joining by email domain confirmed by an emailed link, Enterprise contract limits, and transfers that leave endpoint credentials behind and need room for this month's usage. |
| 1.1.0 | 0.10.0 | Organizations, Stripe billing and joining by email domain. |
What needs API 1.3.0. Structures of family: "graph"; features of type text, tokens, sequence, tensor and audio, and features with generated: true; the eight new tasks; pattern and stop_words on word tokenizers; inference.type: "agent"; POST …/generate, POST …/tokenize and the agent routes; profile on single-model reads and writes; channel_start and attention focus on activations; skipped on responsibility; ?side=N pictures of parameters; tensors sent as shapes with a view; binary tensors of whole numbers and flags. 1.3.0 also brings the limits that keep one model from holding the server: a time budget for each request (what a request may spend) and limits on what agents may hold (jobs, rows and answers).
What needs client 0.12.0. via=, sample=, inputs=, output=, labels=, tokenizer=, max_length=, save_onnx= and sampler= on uploads, TensorFlow SavedModels, .tflite and .gguf files, JAX and Flax models, and scikit-learn text and ColumnTransformer pipelines, weights="pictures", ONNX models given directly, kaimei.agent and python -m kaimei.agent, kaimei.text.tokenizer_spec, client.models.generate (with seeds and draw), tokenize, parameter_view and agent_status, and channel_start on client.models.activations. Deploy the API first. Against an earlier API, the calls 0.11.0 had work as they did, with two differences: with onnx installed, via="auto" uploads a model the earlier API cannot run as Kaimei's own readers read it (refused, or drawn and not run), with a warning that API 1.3.0 runs it, while via="onnx", an ONNX model given directly and upload_structure raise an error naming API 1.3.0; and upload_tensors sends an array of whole numbers or flags in its own type, which the earlier API refuses (dtype="f32" sends it as before).
Older clients against 1.3.0. Their calls have the same paths and fields. A model listing may hold the new tasks and feature types, and single-model reads and writes carry profile, which they ignore. Two answers differ from before: a classifier with more than 200 classes lists its 20 most likely in probabilities, with classes and truncated: true, and silencing a stage the model has no finite answer without lists it in skipped, where the whole request used to be 422 non_finite_output.