All integrationsModel Hosting
Replicate Integration
Call custom or open-weight models Replicate hosts, from a Celery worker.
Replicate hosts thousands of community and custom models behind a simple HTTP API. It's a reasonable fit when you need a model outside the kit's built-in OpenAI/Anthropic layer — image generation, fine-tuned open models, or niche inference tasks.
Setup in 4 steps
- 1Add REPLICATE_API_TOKEN to your .env
- 2Install the replicate Python client
- 3Call replicate models from a Celery task, not the request path — inference can take seconds to minutes
- 4Store the prediction ID and poll or use Replicate's webhook to update job status
What's included
- Access to thousands of open and custom models via one API token
- Fits naturally into the kit's existing Celery background job pattern
- Useful for image/video generation or fine-tuned models the built-in LLM layer doesn't cover
- Webhook support avoids polling for long-running predictions
Code example
# app/tasks/replicate_task.py
import replicate
@celery.task
def run_replicate_model(job_id: str, model: str, inputs: dict):
prediction = replicate.run(model, input=inputs)
update_job_result(job_id, output=prediction)
@router.post("/v1/generate/image")
async def generate_image(body: ImageGenRequest, key: APIKey = Depends(get_api_key)):
job = run_replicate_model.delay(body.job_id, "stability-ai/sdxl", body.params)
return {"job_id": job.id, "status": "processing"}Full documentation: /docs/llm-providers
Replicate integration pre-wired and ready.
FastAPI AI Kit ships with Replicate configured out of the box. No manual setup required.
Ready to ship your AI backend this weekend?
Join developers who skipped weeks of boilerplate and went straight to building.
No subscriptions · One-time payment · Lifetime updates
