Skip to content

Repository files navigation

Replicate Provider for Kujo

Version License built with Kujo

Native Replicate prediction lifecycle client for Kujo. Create, inspect, cancel, and synchronously wait for model predictions while preserving provider output and file references.

Install

kujo kennel add github:kujolang/replicate@v0.1.0
kujo kennel install

30-second quick start

from 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"])

Native Provider API

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.

AI SDK integration

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.

Authentication and security

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.

Testing and docs

bash scripts/release_quality_gate.sh

Default tests are deterministic and credential-free. See docs/ for the implementation report and Contract v1 conformance evidence.

About

Native Replicate prediction lifecycle client for Kujo

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages