--- id: replicate version: "1.0.7" license: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # replicate — Python client for Replicate License: permissive · Maintenance: aging · Downloads: 1.8M/mo ## 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 above — verify before relying. A Python client for running machine learning models on Replicate's API, supporting synchronous and asynchronous execution, file streaming, and webhook-based background jobs. 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 pip install replicate uv add replicate poetry add replicate ## Installing replicate 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. 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) Requires REPLICATE_API_TOKEN environment variable set with a valid API token from replicate.com/account. 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: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 1.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags replicate api client, run ml models python, machine learning inference, async model execution, streaming model output, replicate predictions, ai model api wrapper, ml-inference, async-ready, api-client [View on SkillFed](https://skillfed.io/packages/replicate) · [View on PyPI](https://pypi.org/project/replicate/)