Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
Merge PR #145: fix Zhipu AI API key env var
Re-bin9a98ab1747f1
diff --cc nanobot/providers/litellm_provider.pyindex 1dbee8ea1,a15f05eda..7a2d373df--- a/nanobot/providers/litellm_provider.py+++ b/nanobot/providers/litellm_provider.py@@@ -51,9 -53,13 +53,14 @@@ class LiteLLMProvider(LLMProvider)os.environ.setdefault("GEMINI_API_KEY", api_key)elif "zhipu" in default_model or "glm" in default_model or "zai" in default_model:os.environ.setdefault("ZAI_API_KEY", api_key)+ os.environ.setdefault("ZHIPUAI_API_KEY", api_key)+ elif "dashscope" in default_model or "qwen" in default_model.lower():+ os.environ.setdefault("DASHSCOPE_API_KEY", api_key)elif "groq" in default_model:os.environ.setdefault("GROQ_API_KEY", api_key)+ elif "moonshot" in default_model or "kimi" in default_model:+ os.environ.setdefault("MOONSHOT_API_KEY", api_key)+ os.environ.setdefault("MOONSHOT_API_BASE", api_base or "https://api.moonshot.cn/v1")if api_base:litellm.api_base = api_base@@@ -93,11 -99,28 +100,29 @@@if ("glm" in model.lower() or "zhipu" in model.lower()) and not (model.startswith("zhipu/") ormodel.startswith("zai/") or- model.startswith("openrouter/")+ model.startswith("openrouter/") or+ model.startswith("hosted_vllm/")):model = f"zai/{model}"-++ # For DashScope/Qwen, ensure dashscope/ prefix+ if ("qwen" in model.lower() or "dashscope" in model.lower()) and not (+ model.startswith("dashscope/") or+ model.startswith("openrouter/")+ ):+ model = f"dashscope/{model}"++ # For Moonshot/Kimi, ensure moonshot/ prefix (before vLLM check)+ if ("moonshot" in model.lower() or "kimi" in model.lower()) and not (+ model.startswith("moonshot/") or model.startswith("openrouter/")+ ):+ model = f"moonshot/{model}"++ # For Gemini, ensure gemini/ prefix if not already present+ if "gemini" in model.lower() and not model.startswith("gemini/"):+ model = f"gemini/{model}"++# For vLLM, use hosted_vllm/ prefix per LiteLLM docs# Convert openai/ prefix to hosted_vllm/ if user specified itif self.is_vllm: