Native Replicate prediction lifecycle client for Kujo. Create, inspect, cancel, and synchronously wait for model predictions while preserving provider output and file references.
kujo kennel add github:kujolang/replicate@v0.1.0
kujo kennel installfrom replicate import create_client, create_prediction
client := create_client({
"model": "black-forest-labs/flux-schnell",
})
prediction := create_prediction(client, {
"input": {
"prompt": "A monochrome Kujo mascot",
},
})
print(prediction["data"]["status"])
Replicate's center of gravity is a prediction, not chat. Use model/version
references, deployment paths, Prefer: wait, status polling, cancellation, and
native output values directly.
from replicate import create_client, create_prediction, get_prediction, cancel_prediction
client := create_client({
"token": env("REPLICATE_API_TOKEN"),
"model": "owner/model",
})
created := create_prediction(client, {
"input": {
"prompt": "A clean developer tool icon",
},
"wait": true,
})
prediction_id := created["data"]["id"]
status := get_prediction(client, prediction_id)
cancelled := cancel_prediction(client, prediction_id)
create_prediction, get_prediction, cancel_prediction, list_models, and
list_deployments preserve native status, output, error, timestamps, and URLs.
The package does not automatically download arbitrary output URLs.
Prediction jobs and media generation have no stable one-to-one AI SDK chat semantic, so this release intentionally exposes no AI SDK provider factory. Use the native lifecycle API; a future AI SDK operation will be added only when the semantic contract is explicit.
Set REPLICATE_API_TOKEN. Credentials are sent only to
https://api.replicate.com, embedded URL credentials and remote HTTP are
rejected, and errors redact the token.
bash scripts/release_quality_gate.shDefault tests are deterministic and credential-free. See docs/ for
the implementation report and Contract v1 conformance evidence.