Performance & cost
This session
- Delivery time · median
- —
- Live model compute
- —
- Live input tokens
- 0
- Est. cost · USD
- $0.00
Bypass examples to measure live inference. Uses your quota.
Measurement details · 0 successful requests
- Successful requests
- 0
Run an example for free to see its measurements.
Model compute is the average per measured request. Delivery time is the median browser time for successful requests, including queue, network, and retries. Cached delivery speed is not inference speed. Model compute can exceed browser time when one request processes many inputs.
Tokens come from response headers. Inference costs use $0.04 per million input tokens, before plan credits. The estimate includes live and recorded tokens at the same rate; cached examples are not charged again. Missing usage is unavailable or a partial total (≥). Demo resets keep these totals; reload to start a new session.
Describe what you need, then select Find best action.
Build with the SDKTypeScript · Python · dm1
One request from this demo. Copy it into your app.
Uses your MS_API_KEY and quota. Keep the key on your server.
npm install @cloudraker/milliseconds
export MS_API_KEY="your-api-key"import { DecisionMachine } from "@cloudraker/milliseconds";
// Run on your server; reads MS_API_KEY from the environment.
const dm = new DecisionMachine();
const { result, usage } = await dm.classify(
"\"dark\"",
{
"c0": "The query names the system setting \"Toggle Dark Mode\" (switch appearance between light and dark).",
"c1": "The query describes the web page \"Transformer (deep learning) - Wikipedia\" (en.wikipedia.org, visited yesterday)."
}
).withUsage();
console.log(result);
console.log({ inputTokens: usage.inputTokens, modelMs: usage.inferenceMs });import { DecisionMachine } from "@cloudraker/milliseconds";
// Run on your server; reads MS_API_KEY from the environment.
const dm = new DecisionMachine();
const { result, usage } = await dm.yesNo(
"Query: \"dark\". The complete list of items the launcher can run: Toggle Dark Mode (Switch appearance between light and dark); Transformer (deep learning) - Wikipedia (en.wikipedia.org · visited yesterday); a web search (fallback only).",
[
"The query is specific enough to run the best-matching item straight away."
],
{
"when_true": "One listed item is the obvious meaning, so running it would not surprise the user.",
"when_false": "Several listed items fit, so the user still has to pick one from the list."
}
).withUsage();
console.log(result);
console.log({ inputTokens: usage.inputTokens, modelMs: usage.inferenceMs });pip install cloudraker-milliseconds
export MS_API_KEY="your-api-key"from milliseconds import DecisionMachine
# Reads MS_API_KEY from the environment.
dm = DecisionMachine()
result = dm.classify(
"\"dark\"",
{
"c0": "The query names the system setting \"Toggle Dark Mode\" (switch appearance between light and dark).",
"c1": "The query describes the web page \"Transformer (deep learning) - Wikipedia\" (en.wikipedia.org, visited yesterday)."
}
)
print(result)from milliseconds import DecisionMachine
# Reads MS_API_KEY from the environment.
dm = DecisionMachine()
result = dm.yes_no(
"Query: \"dark\". The complete list of items the launcher can run: Toggle Dark Mode (Switch appearance between light and dark); Transformer (deep learning) - Wikipedia (en.wikipedia.org · visited yesterday); a web search (fallback only).",
[
"The query is specific enough to run the best-matching item straight away."
],
when_true="One listed item is the obvious meaning, so running it would not surprise the user.",
when_false="Several listed items fit, so the user still has to pick one from the list."
)
print(result)npm install -g @cloudraker/milliseconds
export MS_API_KEY="your-api-key"# Reads MS_API_KEY. JSON on stdin supplies the complete request.
dm1 classify --json --usage <<'DM1_REQUEST'
{
"text": "\"dark\"",
"labels": {
"c0": "The query names the system setting \"Toggle Dark Mode\" (switch appearance between light and dark).",
"c1": "The query describes the web page \"Transformer (deep learning) - Wikipedia\" (en.wikipedia.org, visited yesterday)."
}
}
DM1_REQUEST# Reads MS_API_KEY. JSON on stdin supplies the complete request.
dm1 yes-no --json --usage <<'DM1_REQUEST'
{
"text": "Query: \"dark\". The complete list of items the launcher can run: Toggle Dark Mode (Switch appearance between light and dark); Transformer (deep learning) - Wikipedia (en.wikipedia.org · visited yesterday); a web search (fallback only).",
"statements": [
"The query is specific enough to run the best-matching item straight away."
],
"when_true": "One listed item is the obvious meaning, so running it would not surprise the user.",
"when_false": "Several listed items fit, so the user still has to pick one from the list."
}
DM1_REQUESTUnder the hood How it works & limitations
API calls/classify/yes-no
How it works
A local candidate list supplies the available items. The model ranks those items, checks whether the request is ready to act on and identifies requests for multiple items.
Demo scope
The items and actions are simulated. Opening a result previews its action inside the demo. The model cannot find files or apps outside the sample catalog.
Inspired by the work of dabit3.