mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
feat(router.py): enable pre-call checks
filter models outside of context window limits of a given message for a model group https://github.com/BerriAI/litellm/issues/872
This commit is contained in:
parent
47b2b0df17
commit
4e70a3e09a
7 changed files with 3417 additions and 526 deletions
|
@ -3605,7 +3605,7 @@ def token_counter(
|
|||
count_response_tokens=count_response_tokens,
|
||||
)
|
||||
else:
|
||||
num_tokens = len(encoding.encode(text)) # type: ignore
|
||||
num_tokens = len(encoding.encode(text, disallowed_special=())) # type: ignore
|
||||
return num_tokens
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue