openlit / openlit

OpenLIT: Complete Observability and Evals for the Entire GenAI Stack, from LLMs to GPUs. Improve your LLM apps from playground to production 📈. Supports 20+ monitoring integrations like OpenAI & LangChain. Collect and Send GPU performance, costs, tokens, user activity, LLM traces and metrics to any OpenTelemetry endpoint in just one line of code.

Home Page:https://docs.openlit.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question]: maybe `reset_to_defaults()` do not call `fetch_pricing_info()`

CherishCai opened this issue · comments

In the OpenlitConfig, should reset_to_defaults() change cls.pricing_info = fetch_pricing_info() to cls.pricing_info = {} ?
It seems that update_config() will still be called fetch_pricing_info() again.

cls.pricing_info = fetch_pricing_info()

Hey @CherishCai

fetch_pricing_info() would still be called once and if empty it would return {}. We could reset_to_defaults() but that technically what fetch_pricing_info() covers considering its returns {} if the pricing cant be found

@patcher9 Thanks for your reply.
It seem to be twice HTTP remote calls now, so look forward to reducing one.

Do you wanna prepare a PR for you idea?

Oh, it's an honor to be a contributor when I get to know openlit better.

I debugged it locally, added print(), and saw that there were indeed two calls to fetch_pricing_info().

so will make a PR for reset_to_defaults() change cls.pricing_info = fetch_pricing_info() to cls.pricing_info = {}.

image