Search before asking
Description
Embedding model calls currently do not consistently report token usage metrics.
Chat models already have a token accounting path: provider usage is attached to the chat response and later recorded as model-level token metrics. Embedding models return only vectors, so provider usage returned by OpenAI-compatible or DashScope-style embedding APIs can be dropped before it reaches the metrics layer.
Affected paths include:
- Direct Java or Python embedding model calls.
- Vector store and RAG paths that auto-generate embeddings during
add, update, or query.
- Cross-language resource paths where the wrapper may receive an action metric group but the provider-side embedding resource performs the actual request.
This makes it harder to validate and compare embedding model cost/usage, especially when a job mixes chat, embedding, and vector store operations. Embedding metrics do not need completionTokens, but should expose input-side token usage, for example promptTokens and totalTokens, under the same model/provider metric dimensions used by chat metrics where possible.
Are you willing to submit a PR?
Search before asking
Description
Embedding model calls currently do not consistently report token usage metrics.
Chat models already have a token accounting path: provider usage is attached to the chat response and later recorded as model-level token metrics. Embedding models return only vectors, so provider usage returned by OpenAI-compatible or DashScope-style embedding APIs can be dropped before it reaches the metrics layer.
Affected paths include:
add,update, orquery.This makes it harder to validate and compare embedding model cost/usage, especially when a job mixes chat, embedding, and vector store operations. Embedding metrics do not need
completionTokens, but should expose input-side token usage, for examplepromptTokensandtotalTokens, under the same model/provider metric dimensions used by chat metrics where possible.Are you willing to submit a PR?