Skip to content

Add support for Replicate.com #4728

@renemrhfr

Description

@renemrhfr

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:

  1. ReplicateChatModel (implements ChatModel)
    Handles text-based LLMS like GPT, Claude, Llama, DeepSeek etc.
  2. ReplicateMediaModel
    Handles image, video and audio generation models like Flux, Sora etc.
  3. ReplicateStructuredModel
    Handles models returning structured JSON objects like embeddings, OCR etc.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions