Skip to content

Your lightweight open-source personal agent.

feat(custom-provider): keep instance-level session affinity header for cache locality

Re-binfb77176cfd41
diff --git a/nanobot/providers/custom_provider.py b/nanobot/providers/custom_provider.py
index 02183f3d9..66df734c6 100644
--- a/nanobot/providers/custom_provider.py
+++ b/nanobot/providers/custom_provider.py
@@ -16,6 +16,7 @@ class CustomProvider(LLMProvider):
def __init__(self, api_key: str = "no-key", api_base: str = "http://localhost:8000/v1", default_model: str = "default"):
super().__init__(api_key, api_base)
self.default_model = default_model
+ # Keep affinity stable for this provider instance to improve backend cache locality.
self._client = AsyncOpenAI(
api_key=api_key,
base_url=api_base,