Add gpt-5.4, glm-4.7-flash, and glm-5 models; fix init idempotency
- Register gpt-5.4 (OpenAI codex auth), glm-4.7-flash, and glm-5 (ZAI) - Add early-exit guard to litellm-init-models.sh: skips registration if gpt-4o already exists in the DB, preventing duplicate entries on re-runs; set FORCE=1 to bypass and add any missing models Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,13 @@ for m in data.get('data', []):
|
||||
print(m['model_name'])
|
||||
" 2>/dev/null)
|
||||
|
||||
# Guard: skip entirely if already initialized (gpt-4o is a reliable sentinel).
|
||||
# Set FORCE=1 to bypass this check and add any missing models.
|
||||
if [ "${FORCE:-0}" != "1" ] && echo "$EXISTING" | grep -qx "gpt-4o"; then
|
||||
echo "Models already registered in DB. Set FORCE=1 to add missing models."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
add_model() {
|
||||
local model_name="$1"
|
||||
local litellm_model="$2"
|
||||
@@ -103,6 +110,7 @@ add_model "gpt-5.1-codex-max" "openai/gpt-5.1-codex-max" "OPENAI_API_KEY"
|
||||
add_model "gpt-5.1-codex-mini" "openai/gpt-5.1-codex-mini" "OPENAI_API_KEY"
|
||||
add_model "gpt-5.2-codex" "openai/gpt-5.2-codex" "OPENAI_API_KEY"
|
||||
add_model "gpt-5.3-codex" "openai/gpt-5.3-codex" "OPENAI_API_KEY"
|
||||
add_model "gpt-5.4" "openai/gpt-5.4" "OPENAI_API_KEY"
|
||||
|
||||
# Anthropic
|
||||
add_model "claude-opus-4-6" "anthropic/claude-opus-4-6" "ANTHROPIC_API_KEY"
|
||||
@@ -134,6 +142,8 @@ add_model "zai-glm-4.5-air" "openai/glm-4.5-air" "ZAI_API_KEY" "https://api.z.ai
|
||||
add_model "zai-glm-4.6" "openai/glm-4.6" "ZAI_API_KEY" "https://api.z.ai/api/coding/paas/v4"
|
||||
add_model "zai-glm-4.7" "openai/glm-4.7" "ZAI_API_KEY" "https://api.z.ai/api/coding/paas/v4"
|
||||
add_model "zai-glm-5" "openai/glm-5" "ZAI_API_KEY" "https://api.z.ai/api/coding/paas/v4"
|
||||
add_model "glm-4.7-flash" "openai/glm-4.7-flash" "ZAI_API_KEY" "https://api.z.ai/api/coding/paas/v4"
|
||||
add_model "glm-5" "openai/glm-5" "ZAI_API_KEY" "https://api.z.ai/api/coding/paas/v4"
|
||||
|
||||
# GitHub Copilot (token-file auth, no API key)
|
||||
add_copilot_model "copilot-gpt-4o" "gpt-4o"
|
||||
|
||||
Reference in New Issue
Block a user