Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: When using hosted_vLLM, the generic token counter is used even if custom_tokenizer is configured #8555

Open
m4oc opened this issue Feb 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@m4oc
Copy link

m4oc commented Feb 15, 2025

What happened?

When using hosted_vLLM, the system uses the generic token counter even when a custom_tokenizer is configured in the settings.

model_info={'id': 'ID', 'db_model': False, 'custom_tokenizer': {'identifier': 'deepseek-ai/deepseek-coder-6.7b-instruct', 'revision': 'main'}, 'input_cost_per_token': 5e-08, 'output_cost_per_token': 2.5e-07}, timeout=6000, max_retries=0)

LiteLLM:DEBUG: utils.py:301 - Token Counter - using generic token counter, for model=deepseek-ai/deepseek-coder-6.7b-instruct

NotImplementedError: num_tokens_from_messages() is not implemented for model gpt-3.5-turbo. See https://github.com/openai/openai-python/blob/main/chatml.md for information on how messages are converted to tokens.

Relevant log output

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

1.61.0

Twitter / LinkedIn details

No response

@m4oc m4oc added the bug Something isn't working label Feb 15, 2025
@m4oc
Copy link
Author

m4oc commented Feb 15, 2025

Digging deeper, I noticed that /utils/token_counter is not being called, so custom_tokenizer always remains None.
From the documentation, it's not clear how to enable it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant