Files
ragflow/conf/models/replicate.json
tmimmanuel 4c9529ef36 Add Replicate chat provider (#14958)
## What
- Add Replicate as a chat provider backed by the documented predictions
API
- Register Replicate in the Go model factory and provider config
- Support non-streaming chat through sync predictions, polling fallback,
streaming through `urls.stream`, model listing, and connection checks

## Notes
- Uses `POST /v1/predictions` with Replicate model identifiers in
`version`, which supports official and community model identifiers
- Maps RAGFlow messages into Replicate prompt-shaped inputs (`prompt`,
optional `system_prompt`) and forwards common documented LLM inputs:
`max_new_tokens`, `temperature`, `top_p`
- Preserves whitespace in SSE output chunks and emits RAGFlow `[DONE]`
at stream completion

## Tests
- `go test -vet=off -run TestReplicate -count=1
./internal/entity/models`
- `go test -vet=off -count=1 ./internal/entity/models`

Refs #14736
2026-05-19 11:10:36 +08:00

28 lines
471 B
JSON

{
"name": "Replicate",
"url": {
"default": "https://api.replicate.com"
},
"url_suffix": {
"chat": "v1/predictions",
"models": "v1/models"
},
"class": "replicate",
"models": [
{
"name": "meta/meta-llama-3-70b-instruct",
"max_tokens": 8192,
"model_types": [
"chat"
]
},
{
"name": "meta/meta-llama-3-8b-instruct",
"max_tokens": 8192,
"model_types": [
"chat"
]
}
]
}