Hi there, I’d like to use Voyage AI’s embedding mo...
# community-help
s
Hi there, I’d like to use Voyage AI’s embedding models in Typesense. I tried to add an embedding field like this:
Copy code
{
  "fields": [
    {
      "name": "embedding",
      "type": "float[]",
      "embed": {
        "from": [
          "name"
        ],
        "model_config": {
          "model_name": "voyage-multilingual-2",
          "api_key": "my_api_key",
          "url": "<https://api.voyageai.com/v1/embeddings>"
        }
      }
    }
  ]
}
But this produces the error: Error: t: Request failed with HTTP code 400 | Server said: Model file not found Anybody have experience with this?
k
We don't support Voyager.
s
That’s a shame, is this on the roadmap?
Or a different way of using this API? It seems rather similar to the OpenAI embedding endpoiunt
k
Do you know if the APIs are openai compatible (i.e. not similar but exactly the same)?
s
Apart from the token usage information returned the request and response are identical
Copy code
curl --request POST \
     --url <https://api.voyageai.com/v1/embeddings> \
     --header "Authorization: Bearer $VOYAGE_API_KEY" \
     --header "content-type: application/json" \
     --data '
{
  "input": [
    "Sample text 1",
    "Sample text 2"
  ],
  "model": "voyage-large-2"
}
'
versus
Copy code
curl <https://api.openai.com/v1/embeddings> \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "input": "Your text string goes here",
    "model": "text-embedding-3-small"
  }'
Response:
Copy code
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        0.0038915484,
        0.010964915,
        -0.035594109,
        "...",
        0.011034692
      ],
      "index": 0
    },
    {
      "object": "embedding",
      "embedding": [
        -0.01539533,
        -0.0011246679,
        0.021264801,
        "...",
        -0.046319865
      ],
      "index": 1
    }
  ],
  "model": "voyage-large-2",
  "usage": {
    "total_tokens": 10
  }
}
versus:
Copy code
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [
        -0.006929283495992422,
        -0.005336422007530928,
        ... (omitted for spacing)
        -4.547132266452536e-05,
        -0.024047505110502243
      ],
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 5,
    "total_tokens": 5
  }
}
They only difference I see is in the usage information
k
Thanks for providing those examples. Can you please create a github issue as a feature request? We can add to our roadmap.
s
@Kishore Nallan I have created an issue here: https://github.com/typesense/typesense/issues/2080 Thanks
ty 1
I assume it will be hard to say anything about when this might be picked up?
k
Yes, we try to prioritiize ongoing work periodically and balance between larger and smaller stories. Some of it is also driven by community feedback. So far we have not had much demand for Voyage API support, which is why we don't have it yet.