Get started

Switching from another decision API

Keep your requests, change the address and key, compare on your own cases.

If you already call a decision API that takes a situation and typed questions and returns probabilities, you can try Myles without rewriting your client. This page covers the shortest path: keep your requests, change the address and key, compare on your own cases, then move over.

1. Keep your requests

POST https://api.launchables.ai/v1/systemone accepts the same request as POST /v1/decide and returns the same response, in the shape existing decision-model clients expect. In most clients only two settings change:

  • The base address: https://api.launchables.ai.
  • The key: a Launchables key from the console, sent as a bearer token (see Authentication). Keys work once the account has prepaid credit.

Add "model": "myles-g-12b" or "model": "myles-g-31b" to each request so you know which model answered. See Model library for the difference.

2. What is different

  • Extra fields in answers. choice and score answers also carry confidence, and score answers carry legend. Clients that ignore fields they do not know see no change.
  • Calibrated probabilities. Thresholds set against another model's scores will not carry over unchanged. Set them again on your own cases (step 3).
  • Committed yes/no answers. Uncertain yes/no answers are reported at least 0.80 towards the chosen side; see noul.
  • Billing. Input tokens only, output free, from prepaid credit in pounds. See Pricing.
  • Limits. 1,200 requests a minute per key by default, up to 16 questions per request. See Errors and limits.

The full list of accepted variations is in Compatibility.

3. Compare on your own cases

Before switching traffic, send the same labelled sample to both APIs and compare. A few hundred real cases, each with the answer a careful person would give, are enough to see the difference in accuracy and in how often each one is confidently wrong.

import json, os, requests

CASES = [json.loads(line) for line in open("labelled.jsonl")]   # {"request": {...}, "label": "billing"}

def ask(url, token, request):
    reply = requests.post(url, json=request, timeout=60,
                          headers={"Authorization": f"Bearer {token}"})
    reply.raise_for_status()
    return reply.json()["answers"]["route"]

right = confident_wrong = 0
for case in CASES:
    request = {**case["request"], "model": "myles-g-12b"}
    answer = ask("https://api.launchables.ai/v1/systemone", os.environ["LAUNCHABLES_API_TOKEN"], request)
    right += answer["choice"] == case["label"]
    confident_wrong += answer["choice"] != case["label"] and answer["probabilities"][answer["choice"]] >= 0.9
print(f"accuracy {right / len(CASES):.1%}, confidently wrong {confident_wrong / len(CASES):.1%}")

Run the same loop against your current provider and compare the two lines. Then choose thresholds as described in Acting on the answer.

4. Move to /v1/decide

When you are ready, change the path from /v1/systemone to /v1/decide. The request and response stay the same, and new features are documented against /v1/decide first. The Python and JavaScript SDKs call it for you.

Need help?

For a larger migration, or to compare on data that cannot leave your network, contact us.