fix(automod): force float encoding for embeddings — Nvidia models reject base64
Build & Deploy (Nix) / build-and-deploy (backend) (push) Successful in 1m35s
Build & Deploy (Nix) / build-and-deploy (discord-gateway) (push) Successful in 2m24s
Build & Deploy (Nix) / build-and-deploy (proxy) (push) Successful in 2m51s
Build & Deploy (Nix) / build-and-deploy (backend) (push) Successful in 1m35s
Build & Deploy (Nix) / build-and-deploy (discord-gateway) (push) Successful in 2m24s
Build & Deploy (Nix) / build-and-deploy (proxy) (push) Successful in 2m51s
OpenAI SDK v6 defaults to encoding_format=base64; llama-nemotron-embed (Nvidia-backed) returns 400 'do not support base64'. Semantic cache was silently disabled in prod. encoding_format: 'float' fixes it.
This commit is contained in:
@@ -61,6 +61,9 @@ export async function embedTexts(texts: string[]): Promise<number[][] | null> {
|
|||||||
const response = await client.embeddings.create({
|
const response = await client.embeddings.create({
|
||||||
model: config.AI_LLM_EMBEDDING_MODEL as string,
|
model: config.AI_LLM_EMBEDDING_MODEL as string,
|
||||||
input: texts,
|
input: texts,
|
||||||
|
// OpenAI SDK v6 defaults to base64; Nvidia-backed embedding models
|
||||||
|
// (e.g. llama-nemotron-embed) reject it with 400. Always float.
|
||||||
|
encoding_format: "float",
|
||||||
});
|
});
|
||||||
return response.data.map((item) => item.embedding);
|
return response.data.map((item) => item.embedding);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user