You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revise and expand documentation for replicate.use()
Replaces the experimental section on `replicate.use()` with a more detailed and updated guide, including usage examples for image and language models, streaming, chaining, async support, accessing URLs, and prediction creation. Removes references to the API being experimental and updates model examples to use Anthropic Claude instead of Meta Llama.
To create a prediction without waiting for it to complete, use the `create()` method:
170
+
171
+
```python
172
+
import replicate
173
+
174
+
claude = replicate.use("anthropic/claude-4.5-sonnet")
175
+
176
+
# Start the prediction
177
+
run = claude.create(prompt="Explain quantum computing")
178
+
179
+
# Check logs while it's running
180
+
print(run.logs())
181
+
182
+
# Get the output when ready
183
+
result = run.output()
184
+
print(result)
185
+
```
186
+
187
+
### Current limitations
188
+
189
+
- The `use()` method must be called at the module level (not inside functions or classes)
190
+
- Type hints are limited compared to the standard client interface
191
+
65
192
## Run a model
66
193
67
194
You can run a model synchronously using `replicate.run()`:
@@ -535,137 +662,6 @@ with Replicate() as replicate:
535
662
# HTTP client is now closed
536
663
```
537
664
538
-
## Experimental: Using `replicate.use()`
539
-
540
-
> [!WARNING]
541
-
> The `replicate.use()` interface is experimental and subject to change. We welcome your feedback on this new API design.
542
-
543
-
The `use()` method provides a more concise way to call Replicate models as functions. This experimental interface offers a more pythonic approach to running models:
run = llama.create(prompt="Explain quantum computing")
654
-
655
-
# Check logs while it's running
656
-
print(run.logs())
657
-
658
-
# Get the output when ready
659
-
result = run.output()
660
-
print(result)
661
-
```
662
-
663
-
### Current limitations
664
-
665
-
- The `use()` method must be called at the module level (not inside functions or classes)
666
-
- Type hints are limited compared to the standard client interface
667
-
- This is an experimental API and may change in future releases
668
-
669
665
## Versioning
670
666
671
667
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
0 commit comments