Assign a task
const url = 'https://api.pensievelabs.co/v1/tasks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Flaky test triage","decision":"Decide whether a failing CI test is a real bug or a flaky test, before it pages an engineer.","answers":[{"value":"real_bug"},{"value":"flaky_test"}],"test":{"held_out_cases":2000,"metric":"Right call on each failing test"},"runs_in":"your_vpc","monthly_budget_usd":1500}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pensievelabs.co/v1/tasks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Flaky test triage", "decision": "Decide whether a failing CI test is a real bug or a flaky test, before it pages an engineer.", "answers": [ { "value": "real_bug" }, { "value": "flaky_test" } ], "test": { "held_out_cases": 2000, "metric": "Right call on each failing test" }, "runs_in": "your_vpc", "monthly_budget_usd": 1500 }'Describe a decision your software makes. Pensieve’s agents run experiments on your data to find the post-training for it, starting with a first recipe that is queued at once. Kept changes add up to a recipe; a trained recipe is a version. A version ships once it beats the live version (if there is one) and the best frontier model on your test, runs in shadow, and is signed off by your expert.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Any unique string. Sending it again within 24 hours returns the first response.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The judgement call your software makes.
object
Ids of connected sources it learns from.
object
One example case, as text.
Example
{ "name": "Flaky test triage", "decision": "Decide whether a failing CI test is a real bug or a flaky test, before it pages an engineer.", "answers": [ { "value": "real_bug" }, { "value": "flaky_test" } ], "test": { "held_out_cases": 2000, "metric": "Right call on each failing test" }, "runs_in": "your_vpc", "monthly_budget_usd": 1500}Responses
Section titled “Responses”The new model, building.
object
The decision the model makes, in one sentence.
building: no version beats the frontier yet. shadow: a version runs beside live traffic. live: a
version takes traffic. paused: taken off traffic in the app, so your code answers every call until
it is resumed. archived: retired in the app; it answers no calls, and lists leave it out unless you
ask for status=archived.
object
What your code receives.
The outcomes you send back for its calls.
JSON Schema for input, when the model takes structured cases.
The live version (or best candidate) against the best frontier model, on your test.
object
The lead in points out of 100; negative when behind.
The best frontier model at the last re-test.
object
Under this confidence a call falls back.
Whether Pensieve’s agents are running experiments on it. Pause and resume them with models.update.
Compute for experiments this month. Serving is not counted here.
object
The cap; null for none.
Example
{ "id": "mdl_7f3a91c2", "object": "model", "slug": "grade-audit", "name": "Grade audit", "status": "building", "live_version": "v7", "answers": [ { "value": "false_pass", "label": "False pass" } ], "metric": "Right verdict on the grade", "routing": { "object": "routing", "mode": "observe" }, "owner": "Environments team"}default
Section titled “default”Something went wrong; error.type says what.
object
object
The request field the error is about.
Example
{ "error": { "type": "invalid_request" }}