Skip to main content
Incubating Status GitHubReplicate.com

Overview

This project provides Spring AI integration for Replicate.com, enabling access to hundreds of AI models for text generation, image/video/audio generation, embeddings, classification, and more. Replicate hosts a wide variety of AI models with varying input/output schemas. Rather than creating model-specific implementations, this integration provides four flexible adapter models that work with any Replicate model:

ReplicateChatModel

Conversational LLMs (Claude, GPT, Llama, Grok, etc.)

ReplicateMediaModel

Media generation (images, video, audio)

ReplicateStringModel

String outputs (classifiers, detectors)

ReplicateStructuredModel

Structured outputs (embeddings, JSON responses)
Version: 1.0.0-SNAPSHOT Maven snapshot artifacts are available from Maven Central Snapshots

Project Structure

Quick Start

Add Dependency

Configure Models

Configure via application.properties:
All model beans are automatically created and available for injection.

Usage Examples

Chat Model (Conversational AI)

Streaming support:

Media Model (Image/Video/Audio Generation)

String Model (Classification/Detection)

Two ways to upload resources to Replicate: File Upload:
Base64 Encoding:

Structured Model (Embeddings)

Per-Request Options

Override configuration on a per-request basis:
Chat Model Options: Use ReplicateChatOptions for chat models to integrate with Spring AI conventions. Other models use ReplicateOptions.

Important Notes

Multi-turn Conversations: The current implementation does not support multi-turn conversations with conversation history. Each call is independent due to varying model schemas.

Model Discovery

Visit Replicate.com/explore to discover available models. Each model has different input parameters - check the model’s documentation for specific requirements.

Resources

GitHub Repository

View source code and contribute

Replicate Models

Explore hundreds of available AI models

Spring AI Documentation

Spring AI reference documentation

Replicate Documentation

Replicate API documentation

License

Spring AI Replicate is Open Source software released under the Apache 2.0 license.