Replicate
replicateYAML config
providers:
- id: replicate:<your-model>
config:
apiKey: ${REPLICATE_API_KEY}TypeScript usage
import { createProvider } from "@evalguard/core";
const provider = createProvider("replicate", process.env.REPLICATE_API_KEY);
const response = await provider.complete({
model: "<your-model>",
messages: [{ role: "user", content: "Hello" }],
});Authentication
Set REPLICATE_API_KEY in your environment. EvalGuard validates the key on first call and surfaces typed errors for 401 / 403 / rate-limit responses (with Retry-After parsing).
Setup walkthrough
- 1. Sign up for a Replicate account at replicate.com.
- 2. Obtain your API key from the account settings.
- 3. Install the Replicate Python client using 'pip install replicate'.
- 4. Authenticate your API key in your application using 'replicate.Client(api_token='YOUR_API_KEY')'.
- 5. Choose a model from the Replicate model list and note its model ID for use.
Gotchas
- Rate limits are enforced; ensure you monitor your usage to avoid hitting limits.
- Some models may have regional restrictions, so verify availability in your area.
- API responses can vary in latency; implement retries for better reliability.
Cost note
Pricing for the cheapest models starts at $0.01 per 1,000 tokens, while flagship models can go up to $0.20 per 1,000 tokens.
Recommended models
- Eval / judge
- gpt-3.5-turbo
- Agent / tool-use
- gpt-4
- Code
- code-davinci-002
- Vision
- stable-diffusion
LLM-generated (llm-gpt-4o) · 2026-05-23