Skip to content

Add OVHcloud embeddings usage extractor - #441

Open
dsfaccini wants to merge 1 commit into
mainfrom
ovhcloud-embeddings-extractor
Open

Add OVHcloud embeddings usage extractor#441
dsfaccini wants to merge 1 commit into
mainfrom
ovhcloud-embeddings-extractor

Conversation

@dsfaccini

@dsfaccini dsfaccini commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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.tsinitializeAPIFlavor), but prices/providers/ovhcloud.yml only defined a chat extractor. Any embeddings call would cause extractUsage to throw:

Unknown apiFlavor 'embeddings', allowed values: chat

…tripping the gateway's circuit-breaker and returning invalid response, unable to extract usage to the caller.

Fix: add a second extractor for api_flavor: embeddings using prompt_tokens → input_tokens — the standard OpenAI-compatible embeddings usage shape.

- api_flavor: embeddings
  root: usage
  model_path: model
  mappings:
    - path: prompt_tokens
      dest: input_tokens

This matches the shape used by openai.yml and doubleword.yml embeddings 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.yml embeddings extractors). No OVHcloud API key was available to confirm the exact usage object 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 — adds embeddings extractor (existing chat extractor unchanged)
  • packages/js/src/data.ts, packages/python/genai_prices/data.py, prices/data.json, prices/data_slim.json — regenerated
  • tests/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

Review in cubic

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.
@dsfaccini dsfaccini self-assigned this Jul 1, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant