Closed silver5753 closed 10 months ago
Good idea.
There is a chance that we may not update the prices ASAP. As such, we should probably switch our price model to a repo that more actively keeps these prices updated. We grabbed our most recent prices from LiteLLM. To make things easier, I'm going to set them as the source of truth on pricing.
I've also included a fallback file model_prices.json
in case the request doesn't go through. We'll keep this file regularly updated, though perhaps not as regular as LiteLLM.
I'm raising a pull request and major version update to include this #24
Fixed in latest release. Thanks for flagging @silver5753
https://github.com/AgentOps-AI/tokencost/blob/0eb8d23999bc12670643a89af2cf4be64747f668/tokencost/constants.py#L25
Python packages have a tendency to never get updated, so it might be a good idea to add a call to the github repo's raw yaml when loading the package. That way at least the prices stay up to date.
Something like this: