Skip to content

Commit 8b43b83

Browse files
authored
Merge pull request #3 from replicate/improve-schema-validation-guidance
docs: add schema validation and optional input guidance
2 parents 12414dc + f1e7fd9 commit 8b43b83

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

skills/replicate/SKILL.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ Models take time to run. There are three ways to run a model via API and get its
4444
Follow these guideliness when running models:
4545

4646
- Use the "POST /v1/predictions" endpoint, as it supports both official and community models.
47-
- Every model has its own OpenAPI schema. Always fetch and check model schemas to make sure you're setting valid inputs.
47+
- Every model has its own OpenAPI schema. Always fetch and check model schemas to make sure you're setting valid inputs. Even popular models change their schemas.
48+
- Validate input parameters against schema constraints (minimum, maximum, enum values). Don't generate values that violate them.
49+
- When unsure about a parameter value, use the model's default example or omit the optional parameter.
50+
- Don't set optional inputs unless you have a reason to. Stick to the required inputs and let the model's defaults do the work.
4851
- Use HTTPS URLs for file inputs whenever possible. You can also send base64-encoded files, but they should be avoided.
4952
- Fire off multiple predictions concurrently. Don't wait for one to finish before starting the next.
5053
- Output file URLs expire after 1 hour, so back them up if you need to keep them, using a service like Cloudflare R2.

0 commit comments

Comments
 (0)