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.
Choose a command and press Enter.
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.yesNo(
"ls\n[in /Users/devin/repo; ls is on the PATH; git branch main (the default branch), working tree dirty]",
[
"This command throws away work that is stored nowhere else: uncommitted edits, commits, branch history, or the only copy of a file.",
"The target of this command is dangerous: the home directory, the filesystem root, a system folder, a production host, or the shared main branch.",
"This command changes history that other people have already pulled.",
"The command line contains a literal secret value such as an API key, a token or a password.",
"The password for this database is typed on the command line instead of at a prompt."
]
).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.classify(
"ls\n[in /Users/devin/repo; ls is on the PATH; git branch main (the default branch), working tree dirty]",
{
"run": "A safe, ordinary command. Let it run with no questions.",
"confirm": "A risky command that is probably intended. Ask the developer to confirm.",
"block": "A catastrophic mistake. Refuse to run it."
}
).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.yes_no(
"ls\n[in /Users/devin/repo; ls is on the PATH; git branch main (the default branch), working tree dirty]",
[
"This command throws away work that is stored nowhere else: uncommitted edits, commits, branch history, or the only copy of a file.",
"The target of this command is dangerous: the home directory, the filesystem root, a system folder, a production host, or the shared main branch.",
"This command changes history that other people have already pulled.",
"The command line contains a literal secret value such as an API key, a token or a password.",
"The password for this database is typed on the command line instead of at a prompt."
]
)
print(result)from milliseconds import DecisionMachine
# Reads MS_API_KEY from the environment.
dm = DecisionMachine()
result = dm.classify(
"ls\n[in /Users/devin/repo; ls is on the PATH; git branch main (the default branch), working tree dirty]",
{
"run": "A safe, ordinary command. Let it run with no questions.",
"confirm": "A risky command that is probably intended. Ask the developer to confirm.",
"block": "A catastrophic mistake. Refuse to run it."
}
)
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 yes-no --json --usage <<'DM1_REQUEST'
{
"text": "ls\n[in /Users/devin/repo; ls is on the PATH; git branch main (the default branch), working tree dirty]",
"statements": [
"This command throws away work that is stored nowhere else: uncommitted edits, commits, branch history, or the only copy of a file.",
"The target of this command is dangerous: the home directory, the filesystem root, a system folder, a production host, or the shared main branch.",
"This command changes history that other people have already pulled.",
"The command line contains a literal secret value such as an API key, a token or a password.",
"The password for this database is typed on the command line instead of at a prompt."
]
}
DM1_REQUEST# Reads MS_API_KEY. JSON on stdin supplies the complete request.
dm1 classify --json --usage <<'DM1_REQUEST'
{
"text": "ls\n[in /Users/devin/repo; ls is on the PATH; git branch main (the default branch), working tree dirty]",
"labels": {
"run": "A safe, ordinary command. Let it run with no questions.",
"confirm": "A risky command that is probably intended. Ask the developer to confirm.",
"block": "A catastrophic mistake. Refuse to run it."
}
}
DM1_REQUESTUnder the hood How it works & limitations
API calls/yes-no/classify
How it works
The model checks the command for destructive actions, the wrong target and exposed credentials. Local rules apply the risk thresholds and ask for confirmation when needed.
Demo scope
Commands run in a simulated filesystem inside this page, not on your computer. Typo detection uses a limited command list and can flag valid tools. This demo does not replace a secure execution sandbox.
Inspired by the work of dabit3.