Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: azure default context window (#10129)
cthomas5092e7821127
diff --git a/letta/constants.py b/letta/constants.pyindex 767c0dde3..126d12855 100644--- a/letta/constants.py+++ b/letta/constants.py@@ -259,6 +259,10 @@ LLM_MAX_CONTEXT_WINDOW = {"glm-4.7": 180000,"glm-5": 180000,"glm-5-code": 180000,+ # kimi (moonshot)+ "kimi-k2.5": 262144,+ "kimi-k2-thinking": 256000,+ "kimi-k2-0905": 262144,## OpenAI models: https://platform.openai.com/docs/models/overview# gpt-5"gpt-5": 272000,diff --git a/letta/schemas/providers/azure.py b/letta/schemas/providers/azure.pyindex 11fa24524..eacdccb08 100644--- a/letta/schemas/providers/azure.py+++ b/letta/schemas/providers/azure.py@@ -283,8 +283,12 @@ class AzureProvider(Provider):def get_model_context_window(self, model_name: str) -> int | None:# Hard coded as there are no API endpoints for this- llm_default = LLM_MAX_CONTEXT_WINDOW.get(model_name, 4096)- return AZURE_MODEL_TO_CONTEXT_LENGTH.get(model_name, llm_default)+ if model_name in AZURE_MODEL_TO_CONTEXT_LENGTH:+ return AZURE_MODEL_TO_CONTEXT_LENGTH[model_name]+ basename = model_name.rsplit("/", 1)[-1].lower()+ if basename in LLM_MAX_CONTEXT_WINDOW:+ return LLM_MAX_CONTEXT_WINDOW[basename]+ return LLM_MAX_CONTEXT_WINDOW["DEFAULT"]async def get_model_context_window_async(self, model_name: str) -> int | None:"""Get context window size, using litellm specs for v1 endpoints or hardcoded map for legacy."""