Add support for Replicate.com
I would like to propose adding support for Replicate, which is a provider for various AI Models for text generation, image/video/audio, embeddings and more.
Replicate provides access to those models through a unified API where only Input/Output Values differ depending on the selected model.
I already have the code changes ready and use it a lot in my personal projects. It would be an honour for me to contribute back to spring-ai.
Implementation / Expected Behaviour I would suggest an implementation that provides four model classes to handle various response types:
- ReplicateChatModel (implements ChatModel) Handles text-based LLMS like GPT, Claude, Llama, DeepSeek etc.
- ReplicateMediaModel Handles image, video and audio generation models like Flux, Sora etc.
- ReplicateStructuredModel Handles models returning structured JSON objects like embeddings, OCR etc.
- ReplicateStringModel Handles Models that return simple String outputs like Content Classifiers.
Current Behavior Currently there is no support for Replicate.com.
Future Idea Replicate also supports training, fine-tuning and deploying custom models. We could also add support for this in the future as those opens up a lot of interesting use cases.
I have a PR ready and wanted to ask if this is something you think would be valuable for spring ai. I would be more than happy to contribute
We don't plan to add such support but we would welcome an external repository supporting it, we could reference it in our reference documentation.
I see it was created in https://github.com/spring-ai-community/spring-ai-replicate, so all good.