Compute sandbox
Practice a full Compute job on synthetic data, see the common outcomes, reset it, and then move to one small real test.
Practice with synthetic data
Use the sandbox to learn the task shape, quote review, exceptions and result interpretation. It demonstrates those steps without claiming live capacity, customer data processing or a real charge.
Follow the exercise in this order:
synthetic fixture → replay → inspect outcomes → reset → live-test guidanceUse the built-in synthetic fixture and review every expected item, including the ambiguous/refused case. The optional Python replay below is offline: it needs no Lithi account, package, credential or provider Mac.
The eight-item review table is the concrete example: it contains six accepted items, one invalid item and one abstention. Use it to practice identity matching and exception handling. Discard its quote, receipt and state values before moving to an approved test.
Review eight fictional inputs
The exercise labels clear opinions as positive or negative, preserves item IDs and abstains when a review is ambiguous.
| ID | Fictional review | Expected fixture outcome |
|---|---|---|
| r01 | I love the sturdy handle. | Accepted: positive. |
| r02 | It broke on the first use. | Accepted: negative. |
| r03 | Easy to clean. I recommend it. | Accepted: positive. |
| r04 | The lid leaks. I regret buying it. | Accepted: negative. |
| r05 | It does the job well. | Accepted: positive. |
| r06 | The switch no longer works. | Accepted: negative. |
| r07 | Missing text (None in the program). | Invalid input; no label. |
| r08 | It is light. | Abstained; no label. |
“Light” could be praise or a complaint. Leaving it unanswered follows the exercise's rule.
Replay the example locally
Read the program before running it. With Python 3 already available, save this block as a local file
such as review_exercise.py, then run python3 review_exercise.py. The script writes no files and
makes no network calls. Its fields and state names are teaching labels, not a Lithi API payload or a
real receipt format. The mock quote deliberately contains no price or signature.
# Offline fixture replay: no API, model, credentials, or payment.
INPUTS = [
("r01", "I love the sturdy handle."),
("r02", "It broke on the first use."),
("r03", "Easy to clean. I recommend it."),
("r04", "The lid leaks. I regret buying it."),
("r05", "It does the job well."),
("r06", "The switch no longer works."),
("r07", None),
("r08", "It is light."),
]
FIXTURE = [
("r01", "accepted", "positive"),
("r02", "accepted", "negative"),
("r03", "accepted", "positive"),
("r04", "accepted", "negative"),
("r05", "accepted", "positive"),
("r06", "accepted", "negative"),
("r07", "invalid", None),
("r08", "abstained", None),
]
def fresh_session():
return {"synthetic": True, "reviewed": False, "outcomes": []}
def replay(session):
if session["synthetic"] is not True or session["reviewed"] is not True:
raise ValueError("Review the synthetic example before replay.")
session["outcomes"] = list(FIXTURE)
session = fresh_session()
mock_quote = {"synthetic": True, "scope": "eight fictional reviews",
"authorizes_live_work": False}
print("Synthetic sandbox: no live actions")
print("Mock quote authorizes live work:", mock_quote["authorizes_live_work"])
try:
replay(session)
except ValueError:
print("Before review: replay refused")
session["reviewed"] = True # Example review only; not paid-work approval.
replay(session)
input_ids = [item[0] for item in INPUTS]
outcome_ids = [item[0] for item in session["outcomes"]]
assert len(set(input_ids)) == len(input_ids) == 8
assert sorted(input_ids) == sorted(outcome_ids)
for item_id, state, label in sorted(session["outcomes"],
key=lambda row: row[1] == "accepted"):
print(item_id, state, label)
counts = {state: sum(row[1] == state for row in session["outcomes"])
for state in ("accepted", "invalid", "abstained")}
assert counts == {"accepted": 6, "invalid": 1, "abstained": 1}
print("Counts:", counts)
mock_receipt = {"synthetic": True, "signed": False, "proves_live_work": False}
print("Mock receipt proves live work:", mock_receipt["proves_live_work"])
session = fresh_session()
assert session["reviewed"] is False and session["outcomes"] == []
print("After reset:", len(session["outcomes"]), "outcomes; reviewed:", session["reviewed"])The first replay is refused until the local review flag is set. The program then prints the six
accepted items alongside r07 and r08, reports {'accepted': 6, 'invalid': 1, 'abstained': 1}, and
ends with 0 outcomes; reviewed: False after reset. These checks prove only that the fixture follows
its stated rules. They do not measure classification accuracy or prove network execution.
Reset the exercise
Reset clears the sandbox session state that the product declares resettable. It does not erase screenshots, copied text, browser history or files you saved elsewhere.
A reset is not a production rollback and does not affect a live Compute account.
Practice the outcomes that matter
Work through:
- accepted output;
- invalid/refused input;
- abstention;
- partial result;
- unknown submission/retry decision;
- delivery recovery.
Keep the same rule you will use live: an unknown outcome is reconciled before a retry.
If Python is unavailable, use the input table and count the outcomes by hand. A changed count or assertion failure means the local example differs; compare the IDs and fixture before proceeding. Reset clears only this program's in-memory practice state. It does not erase a saved script, terminal output or copied notes.
Move to a real test deliberately
When you understand the fixture, use Move from sandbox to a live test. A sandbox result is not evidence that your live account has capacity, access or the same model quality.