AgentOps-AI / tokencost

Easy token price estimates for 400+ LLMs. TokenOps.
https://agentops.ai
MIT License
1.48k stars 61 forks source link

Upgrade TikToken to use o200k models for gpt-4o #44

Closed areibman closed 6 months ago

areibman commented 6 months ago

Currently getting estimate errors:

In [2]: messages = [{"role": "user", "content": "hello"}]

In [3]: tokencost.count_string_tokens("Hello! How can I assist you today?", mode
   ...: l="gpt-4o")
WARNING:root:Warning: model not found. Using cl100k_base encoding.
Out[3]: 9