Skip to content

Support for codestral/embedding API kind #4374

@Silzinc

Description

@Silzinc

Please describe the feature you want

Mistral AI made an embedding API for codestral-embed (actually they made another one for mistral-embed, but I don't expect it to be any relevant compared to codestral-embed for this project). This contradicts the tabby docs if I'm not mistaken.

Would it be possible to support a new codestral/embedding (or mistral/embedding) API kind for this?

Additional context

I stumbled on this while trying to configure codestral-embed in tabby.

Here is my current (failing) config for this model:

[model.embedding.http]
kind = "openai/embedding"
model_name = "codestral-embed"
api_endpoint = "https://api.mistral.ai/v1"
api_key = "my-key"

Here, I have been using the openai/embedding API although it is not exectly the one expected by the model. Upon connection, I obtain this error:

Error 422: {"detail":[{"type":"model_attributes_type","loc":["body"],"msg":"Input should be a valid dictionary or object to extract fields from","input":"{\"input\":[\"hello Tabby\"],\"model\":\"codestral-embed\"}"}]}

Besides, this works perfectly fine in my terminal:

curl -X POST "https://api.mistral.ai/v1/embeddings" \
           -H "Content-Type: application/json" \
           -H "Authorization: Bearer $MISTRAL_API_KEY" \
           -d "{\"input\": [\"hello Tabby\"], \"model\": \"codestral-embed\"}"

Thank you in advance!
Please reply with a 👍 if you want this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions