I was trying out Maple Proxy for text embedding when I ran into this issue. I was using it for Obsidian Copilot. Copilot requests "encoding_format": "base64", which is allowed by the OpenAI API.
This is correctly returned from the backend, but the Maple Proxy tried and failed to deserialize the response as floatinstead, leading to a error in the proxy and failing to pass on the response back to the client.
Steps to reproduce:
# Works fine (default float format):
curl -X POST 'http://localhost:8080/v1/embeddings' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <key>' \
-d '{"model": "nomic-embed-text", "input": "Hello!"}'
# Returns 500 Internal Server Error:
curl -X POST 'http://localhost:8080/v1/embeddings' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <key>' \
-d '{"model": "nomic-embed-text", "input": "Hello!", "encoding_format": "base64"}'
This then leads the Maple Proxy to throw this error:
Serialization error: invalid type: string "<base64...>", expected a sequence
I was trying out Maple Proxy for text embedding when I ran into this issue. I was using it for Obsidian Copilot. Copilot requests
"encoding_format": "base64", which is allowed by the OpenAI API.This is correctly returned from the backend, but the Maple Proxy tried and failed to deserialize the response as
floatinstead, leading to a error in the proxy and failing to pass on the response back to the client.Steps to reproduce:
This then leads the Maple Proxy to throw this error: