NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3264 most downloaded on PyPI
Python client for Replicate
Last release 9 months ago
18 Dec 2025
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 55 of 60 stable releases
3 versions withdrawn
withdrawn after publishing
4 years old
120 releases · first in 2022
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
bump version in pyproject.toml to 1.1.0b3
bump version in pyproject.toml to 1.1.0b3
Nothing published for this version
The main change in 1.1.0b1 is the introduction of a new experimental replicate.use() function intended to eventually replace replicate.run() . This pr
The main change in 1.1.0b1 is the introduction of a new experimental replicate.use() function intended to eventually replace replicate.run(). This provides a more expressive function-like interface for calling models.
import replicate
flux_dev = replicate.use("black-forest-labs/flux-dev")
outputs = flux_dev(prompt="a cat wearing an amusing hat")
for output in outputs:
print(output) # /tmp/output.webp
Check out the README.md on the beta branch for more details.
uv for project tooling by @aron in #437replicate.use() function by @aron in #438Full Changelog: 1.0.7...1.1.0b1
If you run replicate-python within a cog model running cog 0.14.11 or later, it is now possible to pass a REPLICATE_API_TOKEN via the context as part
If you run replicate-python within a cog model running cog 0.14.11 or later, it is now possible to pass a REPLICATE_API_TOKEN via the context as part of a prediction request.
The Replicate() constructor will now use this context when available. This grants cog models the ability to use the Replicate client libraries, scoped to a user on a per request basis.
Full Changelog: 1.0.6...1.0.7
There was no 1.0.5 release, the release system failed and we chose not to re-use the identifier.
Full Changelog: 1.0.4...1.0.6
There was no 1.0.5 release, the release system failed and we chose not to re-use the identifier.
Fix two bugs in the base64 file_encoding_strategy by @aron in #398
replicate.run() now correctly converts the file provided into a valid base64 encoded data URL.replicate.async_run() now respects the file_encoding_strategy flag.Full Changelog: 1.0.3...1.0.4
Fix a bug where replicate.run would swallow tokens (or files) at the start of a prediction's output. Thanks to @aron in #383
replicate.run would swallow tokens (or files) at the start of a prediction's output. Thanks to @aron in #383Full Changelog: 1.0.2...1.0.3
Configure read timeout based on wait parameter by @aron in #373
Full Changelog: 1.0.1...1.0.2
1.0.1 candidate by @zeke in #368
This 1.0.0 latest release of replicate contains breaking changes. The replicate.run() method will now return FileObjects rather than URL strings by de…
[!WARNING] Breaking changes
This 1.0.0 latest release of replicate contains breaking changes. The replicate.run() method will now return FileObjects rather than URL strings by default for models that output files.
The FileObject implements an iterable object similar to httpx.Response to make it easier to work with files and ensures that Replicate can deliver file data to the client in the most efficient manner possible.
For example:
[output] = replicate.run(
"black-forest-labs/flux-schnell",
input={"prompt": "astronaut riding a rocket like a horse"},
);
For most basic cases you'll want to utilize either the url or read() fields depending on whether you want to directly consume the file or pass it on.
To access the file URL:
print(output.url) #=> "https://delivery.replicate.com/..."
To consume the file directly:
with open('output.bin', 'wb') as file:
file.write(output.read())
Or for very large files they can be streamed:
with open(file_path, 'wb') as file:
for chunk in output:
file.write(chunk)
Each of these methods has an equivalent asyncio API.
async with aiofiles.open(filename, 'w') as file:
await file.write(await output.aread())
async with aiofiles.open(filename, 'w') as file:
await for chunk in output:
await file.write(chunk)
For streaming responses from common frameworks, all support taking Iterator types:
Django
@condition(etag_func=None)
def stream_response(request):
output = replicate.run("black-forest-labs/flux-schnell", input={...}, use_file_output =True)
return HttpResponse(output, content_type='image/webp')
FastAPI
@app.get("/")
async def main():
output = replicate.run("black-forest-labs/flux-schnell", input={...}, use_file_output =True)
return StreamingResponse(output)
Flask
@app.route('/stream')
def streamed_response():
output = replicate.run("black-forest-labs/flux-schnell", input={...}, use_file_output =True)
return app.response_class(stream_with_context(output))
In case of breakages, in most instances, updating existing applications to call output.url should fix issues.
To revert to previous behaviour you can opt out of FileOutput by passing use_file_output=False to the replicate.run() method.
const replicate = replicate.run("acmecorp/acme-model", use_file_output=False);
Full Changelog: https://github.com/replicate/replicate-python/compare/0.34.2...1.0.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Consistently return Boolean for delete methods by @mattt in https://github.com/replicate/replicate-python/pull/359
Full Changelog: https://github.com/replicate/replicate-python/compare/0.34.0...0.34.1
Add wait parameter to prediction creation methods by @mattt in https://github.com/replicate/replicate-python/pull/354
wait parameter to prediction creation methods by @mattt in https://github.com/replicate/replicate-python/pull/354use_file_output to streaming methods by @mattt in https://github.com/replicate/replicate-python/pull/355Full Changelog: https://github.com/replicate/replicate-python/compare/0.33.0...0.34.0
Introduce experimental FileOutput interface for models that output File and Path types by @aron in https://github.com/replicate/replicate-python/pull/
" by @dimitrisr in https://github.com/replicate/replicate-python/pull/336Full Changelog: https://github.com/replicate/replicate-python/compare/0.32.1...0.33.0
Correctly pass filename to file creation call by @mattt in https://github.com/replicate/replicate-python/pull/343
Full Changelog: https://github.com/replicate/replicate-python/compare/0.32.0...0.32.1
Add support for files API endpoints by @mattt in https://github.com/replicate/replicate-python/pull/226
Full Changelog: https://github.com/replicate/replicate-python/compare/0.31.0...0.32.0
Add support for deployments.delete endpoint by @mattt in https://github.com/replicate/replicate-python/pull/331
deployments.delete endpoint by @mattt in https://github.com/replicate/replicate-python/pull/331Full Changelog: https://github.com/replicate/replicate-python/compare/0.30.1...0.31.0
Add support for models.search endpoint by @mattt in https://github.com/replicate/replicate-python/pull/328
models.search endpoint by @mattt in https://github.com/replicate/replicate-python/pull/328Full Changelog: https://github.com/replicate/replicate-python/compare/0.29.0...0.30.1
> This release wasn't published to PyPI due to a CI failure. Please see v0.30.1 instead.
[!IMPORTANT]
This release wasn't published to PyPI due to a CI failure. Please see v0.30.1 instead.
models.search endpoint by @mattt in https://github.com/replicate/replicate-python/pull/328Full Changelog: https://github.com/replicate/replicate-python/compare/0.29.0...0.30.0
Add prediction field to ModelError by @mattt in https://github.com/replicate/replicate-python/pull/326
prediction field to ModelError by @mattt in https://github.com/replicate/replicate-python/pull/326Full Changelog: https://github.com/replicate/replicate-python/compare/0.28.0...0.29.0
Add support for validating webhooks by @mattt in https://github.com/replicate/replicate-python/pull/321
Full Changelog: https://github.com/replicate/replicate-python/compare/0.27.0...0.28.0
Update recommendations for passing file inputs to models by @mattt in https://github.com/replicate/replicate-python/pull/315
REPLICATE_API_TOKEN isn't set by @mattt in https://github.com/replicate/replicate-python/pull/316models.get and models.delete endpoints by @mattt in https://github.com/replicate/replicate-python/pull/302Full Changelog: https://github.com/replicate/replicate-python/compare/0.26.1...0.27.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →