Add OVHcloud embeddings usage extractor - #441
Open
dsfaccini wants to merge 1 commit into
Open
Conversation
OVHcloud AI Endpoints emit api_flavor: 'embeddings' for embedding requests but the provider only defined a chat extractor. Any embeddings call would cause extractUsage to throw 'Unknown apiFlavor embeddings' and trip the gateway circuit-breaker (same class of bug as MiniMax #437). Adds a second extractor for api_flavor: embeddings using prompt_tokens -> input_tokens -- matching the OpenAI-compatible embeddings response shape used by all OVHcloud AI Endpoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
David's AICA here:
Summary
Flavor-coverage gap — same class as MiniMax #437.
The gateway's OVHcloud provider sets
api_flavor: 'embeddings'for embeddings requests (providers/ovhcloud.ts→initializeAPIFlavor), butprices/providers/ovhcloud.ymlonly defined achatextractor. Any embeddings call would causeextractUsageto throw:…tripping the gateway's circuit-breaker and returning
invalid response, unable to extract usageto the caller.Fix: add a second extractor for
api_flavor: embeddingsusingprompt_tokens → input_tokens— the standard OpenAI-compatible embeddings usage shape.This matches the shape used by
openai.ymlanddoubleword.ymlembeddings extractors. OVHcloud AI Endpoints (oai.endpoints.kepler.ai.cloud.ovh.net) are fully OpenAI-compatible.Verification status
Shape is mirrored from the OpenAI-compatible embeddings convention (
openai.yml/doubleword.ymlembeddings extractors). No OVHcloud API key was available to confirm the exactusageobject empirically, and OVHcloud is not in the gateway's current live route list, so this fixes a latent gap. High confidence on shape (OpenAI-compatible); not empirically confirmed against OVHcloud.Changes
prices/providers/ovhcloud.yml— addsembeddingsextractor (existingchatextractor unchanged)packages/js/src/data.ts,packages/python/genai_prices/data.py,prices/data.json,prices/data_slim.json— regeneratedtests/dataset/usages.json— regenerated snapshot (no OVHcloud embeddings bodies in corpus; ordering of groq/mistral entries shifted alphabetically in unrelated bodies)packages/js/src/__tests__/extractUsage.test.ts— adds OVHcloud embeddings extraction test