Skip to content

Commit bedda92

Browse files
committed
updated max context window default to 100K tokens
1 parent 85458d4 commit bedda92

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

llm_api_client/_version.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""Module to expose version information.
2-
3-
Resilient to running from source without an installed distribution.
42
"""
53
from importlib import metadata
64

llm_api_client/api_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
# Default max context window tokens
2424
DEFAULT_MAX_CONTEXT_TOKENS_ENV_VAR = "DEFAULT_MAX_CONTEXT_TOKENS"
2525
try:
26-
DEFAULT_MAX_CONTEXT_TOKENS = int(os.getenv(DEFAULT_MAX_CONTEXT_TOKENS_ENV_VAR, "20000"))
26+
DEFAULT_MAX_CONTEXT_TOKENS = int(os.getenv(DEFAULT_MAX_CONTEXT_TOKENS_ENV_VAR, "100000"))
2727
except ValueError:
2828
logging.getLogger(__name__).warning(
2929
f"Environment variable {DEFAULT_MAX_CONTEXT_TOKENS_ENV_VAR} must be an integer. "
30-
"Falling back to 20,000 tokens.")
31-
DEFAULT_MAX_CONTEXT_TOKENS = 20_000
30+
"Falling back to 100,000 tokens.")
31+
DEFAULT_MAX_CONTEXT_TOKENS = 100_000
3232

3333

3434
class APIClient:

tests/test_api_client_additional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ def test_get_max_context_tokens_fallback_on_error(mock_get_model_info):
1111
mock_get_model_info.side_effect = RuntimeError("boom")
1212
client = APIClient()
1313

14-
# When litellm raises, the client should fall back to default env value (20_000)
14+
# When litellm raises, the client should fall back to default env value (100_000)
1515
max_tokens = client.get_max_context_tokens("any-model")
1616
assert isinstance(max_tokens, int)
17-
assert max_tokens >= 10_000 # conservative lower bound; default is 20k
17+
assert max_tokens >= 100_000
1818

1919

2020
@patch("litellm.token_counter")

0 commit comments

Comments
 (0)