replicate
Python client for Replicate
Decision gist · record as of 2026-08-14
Yes. This is the official Replicate Python client with low install friction, permissive licensing, and no known vulnerabilities. Install it if you need to call Replicate models from Python—it's the standard integration point. Be aware that the project is aging (last commit August 2025) and the 1.0.0 breaking change around FileOutput requires code updates if upgrading from earlier versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires REPLICATE_API_TOKEN environment variable set with a valid API token from replicate.com/account.
- Low install friction with four lightweight runtime dependencies (httpx, packaging, pydantic, typing_extensions).
- Maintenance status is aging—last commit was 2025-08-26 with 909 repository stars, indicating the project is stable but not actively developed.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache License 2.0 (permissive), allowing commercial and derivative use with minimal restrictions beyond attribution and liability disclaimers.
last release 2025-05-27 (444 days) · last repo commit 2025-08-26 · 909 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,832,814 downloads/mo, #3,509 on PyPI
Alternatives
Verify before relying
pip install replicate
import replicate
outputs = replicate.run(
"black-forest-labs/flux-schnell",
input={"prompt": "astronaut riding a rocket"}
)
for output in outputs:
print(output)- Whether FileOutput's iterable interface and performance characteristics match the documented behavior in production use.
- Specific timeout and retry behavior when predictions exceed the default 60-second wait window.
- Compatibility and stability with all Replicate model versions and input types beyond the documented examples.
What it is and what it does
Replicate is a Python client that connects your code to Replicate's hosted machine learning models via HTTP. It abstracts away API details, letting you run image generation, language models, and other AI tasks with a single function call. The package handles authentication via environment variables, manages prediction lifecycle (starting, polling, streaming), and provides both synchronous and asynchronous interfaces for concurrent workloads.
The 1.0.0 release introduced a breaking change: model outputs that produce files now return FileOutput objects by default instead of URL strings, offering streaming-like iteration over file content. You can opt out with use_file_output=False if needed. The client supports streaming tokens from language models in real time, running predictions in the background with webhook callbacks, and composing multiple model outputs into pipelines.
Use it for
- Generate images by running text-to-image models like Flux or Stable Diffusion with a single replicate.run() call.
- Stream tokens from large language models in real time using replicate.stream() for interactive chatbot or text-generation applications.
- Run multiple model predictions concurrently using async_run() within an asyncio context for batch processing workflows.
- Start long-running predictions in the background and receive webhook notifications when they complete instead of blocking.
- Process files (images, audio) by passing local file handles or URLs to models that accept file inputs.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is the official Replicate Python client with low install friction, permissive licensing, and no known vulnerabilities. Install it if you need to call Replicate models from Python—it's the standard integration point. Be aware that the project is aging (last commit August 2025) and the 1.0.0 breaking change around FileOutput requires code updates if upgrading from earlier versions.
Install
replicate on PyPI
Before you install
Low install friction with four lightweight runtime dependencies (httpx, packaging, pydantic, typing_extensions). Maintenance status is aging—last commit was 2025-08-26 with 909 repository stars, indicating the project is stable but not actively developed.
Requires REPLICATE_API_TOKEN environment variable set with a valid API token from replicate.com/account.
License in practice
Licensed under Apache License 2.0 (permissive), allowing commercial and derivative use with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install replicate
import replicate
outputs = replicate.run(
"black-forest-labs/flux-schnell",
input={"prompt": "astronaut riding a rocket"}
)
for output in outputs:
print(output)
Verify before relying
- Whether FileOutput's iterable interface and performance characteristics match the documented behavior in production use.
- Specific timeout and retry behavior when predictions exceed the default 60-second wait window.
- Compatibility and stability with all Replicate model versions and input types beyond the documented examples.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packageshttpxpackagingpydantictyping_extensions |
| Maintenance | Aging 444 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,832,814 / month, #3,509 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: replicate-1.0.7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “replicate api client”
- replicateA Python client for running machine learning models on Replicate's…
- opentelemetry-instrumentation-replicateAdds OpenTelemetry tracing to Replicate API calls, capturing prompts,…
- pulp-gluepulp-glue is a command-line interface for Pulp 3 that provides…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also opentelemetry-instrumentation-replicate · datarobot-predict · cog · inference-models · fal-client · aiohttp-sse-client2 · gradio-client · lhotse · azure-ai-ml · aleph-alpha-client