Skip to content

Spring AI 2.0.0-M5: Embedding fails with OpenAI-compatible APIs (Base64 string vs float[]) #5901

@arianox

Description

@arianox

Bug description

Spring AI 2.0.0-M5 fails when using OpenAI-compatible embedding APIs (e.g. IONOS bge-m3) due to a mismatch in embedding response format.

The error indicates that the embedding is returned as a string (likely Base64) instead of a float[], which causes deserialization to fail:
json: cannot unmarshal string into Go struct field Embedding.data.embedding of type []float32

This worked correctly in 2.0.0-M4.


Environment

  • Spring AI: 2.0.0-M5
  • Java: 21
  • Spring Boot: 4.0.6
  • Vector Store: Qdrant
  • Dependencies:
    • spring-ai-starter-model-openai
    • spring-ai-qdrant-store
    • spring-ai-rag
  • Provider: IONOS OpenAI-compatible endpoint
  • Model: bge-m3

Steps to reproduce

  1. Configure Spring AI with an OpenAI-compatible endpoint (e.g. IONOS)
  2. Use spring-ai-starter-model-openai
  3. Call embeddings

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions