Skip to content

[Bug]: VoyageAI embedding models fail with "400 status code (no body)" error #525

@native-apps

Description

@native-apps

Bug Description

When attempting to add VoyageAI embedding models through the custom embedding provider interface, the operation fails with a 400 status code (no body) error. This occurs for both voyage-3-large and voyage-4-large models, regardless of whether output dimensions are specified or left blank.

Expected Behavior

The embedding model should be successfully added and validated, enabling its use for RAG indexing.

Technical Analysis

Based on research, VoyageAI's embeddings API is not fully OpenAI-compatible in terms of response format. Specifically:

  • VoyageAI's /v1/embeddings endpoint may not return the complete usage object structure that OpenAI's API provides
  • The "(no body)" error suggests Smart Composer's OpenAI-compatible provider is rejecting VoyageAI's response format before logging the actual error

Requested Enhancement

Would it be possible to add native VoyageAI embedding support or enhance the OpenAI-compatible provider to handle VoyageAI's response format variations?

Steps to reproduce

  1. Create a custom "Provider":
    • ID: voyage
    • Provider Type: OpenAI Compatible
    • API Key: pa-XXXXXXXX (valid VoyageAI key)
    • Base URL: https://api.voyageai.com/v1
  2. Navigate to Embedding Models
  3. Add and Configure custom embedding model:
    • ID: voyage-3-large / voyage-4-large
    • Provider ID: voyage
    • Model Name: voyage-3-large / voyage-4-large
    • Output Dimensions: 2048 (also tested with 1024, and blank)
  4. Click "Add" (See 400 (no body) error notification).

Operating System

macOS

Obsidian Version

1.11.5

Obsidian Installer Version

1.6.7

Smart Composer Version

1.2.9

Screenshots

No response

Error logs

app.js:1 Obsidian Developer Console
plugin:smart-composer:823 Migrating settings from 0 to 1
plugin:smart-composer:823 Migrating settings from 1 to 2
plugin:smart-composer:823 Invalid settings provided, using defaults: TypeError: Cannot read properties of undefined (reading 'baseUrl')
    at Object.DnI [as migrate] (plugin:smart-composer:823:35185)
    at ttl (plugin:smart-composer:823:48169)
    at ncI (plugin:smart-composer:823:48230)
    at VS.loadSettings (plugin:smart-composer:849:583)
    at async VS.onload (plugin:smart-composer:847:3147)
ncI @ plugin:smart-composer:823
plugin:smart-composer:823 Smart composer database initialized. Um
plugin:smart-composer:823 Chat history migration to JSON database completed
plugin:smart-composer:823 Templates migration to JSON database completed
plugin:smart-composer:851 Migration to JSON storage completed successfully
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()
api.voyageai.com/v1/embeddings:1 
        
        
       Failed to load resource: the server responded with a status of 400 ()

Additional context

  • The error occurs during the model validation phase when Smart Composer attempts to test the embedding endpoint
  • Same error occurs for both:
    • voyage-3-large (established model)
    • voyage-4-large (newer model)
  • Error persists regardless of Output Dimensions setting (tested with 2048 dimensions, and blank)
  • VoyageAI API key is confirmed valid (starts with pa-. Note: sometimes when copying the API Key to the clipboard, it may produce a "pa—" instead of a standard dash -).
  • Base URL is correctly set to https://api.voyageai.com/v1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions