Skip to content

Add Execution Cost to Html Reports#243

Merged
philipph-askui merged 17 commits intomainfrom
feat/execution_cost
Mar 12, 2026
Merged

Add Execution Cost to Html Reports#243
philipph-askui merged 17 commits intomainfrom
feat/execution_cost

Conversation

@philipph-askui
Copy link
Contributor

No description provided.

@philipph-askui philipph-askui marked this pull request as draft March 9, 2026 17:46
@philipph-askui philipph-askui marked this pull request as ready for review March 10, 2026 06:13
output_cost_per_million_tokens: float | None = None,
) -> None:
self._model_id_value = (
model_id or os.environ.get("VLM_PROVIDER_MODEL_ID") or _DEFAULT_MODEL_ID
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mlikasam-askui and @philipph-askui ,

we need to discuaa what is the proper way of Reading and Validating Env Variables.

currency: str | None = None
input_cost_per_million_tokens: float | None = None
output_cost_per_million_tokens: float | None = None
if self._pricing is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use early return instaed?

Suggested change
if self._pricing is not None:
if self._pricing is None:
return

Args:
input_cost_per_million_tokens (float): Cost in USD per 1M input tokens.
output_cost_per_million_tokens (float): Cost in USD per 1M output tokens.
currency (str): ISO 4217 currency code. Defaults to ``"USD"``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we say that the string is defined in "ISO 4217" then we should pare it or define a CURRENCY_TYPE.

-> Otherweise name of the currency displayed. e.g. or USD or $ or EUR or Euro



class TestModelPricingForModel:
def test_exact_match_sonnet_4_6(self) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

please rewrite the check with an parameterized test.
https://docs.pytest.org/en/7.1.x/example/parametrize.html

@philipph-askui
Copy link
Contributor Author

@programminx-askui
To clarify a few things:

  • there is a difference between input_cost and input_cost_per_million_tokens. One is the summed input_cost, the other is the rate
  • we have input_cost, output_cost, and total_cost values, as we are using this object to pass it to the reporter. This way 1) the reporter is not responsible for the calculations and 2) we know that the values are set. If not we raise an error early.

@philipph-askui philipph-askui merged commit 77ef748 into main Mar 12, 2026
1 check passed
@philipph-askui philipph-askui deleted the feat/execution_cost branch March 12, 2026 13:59
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.

2 participants