Upload patch_models.py

#8
by bep40 - opened
Files changed (1) hide show
  1. patch_models.py +4 -4
patch_models.py CHANGED
@@ -43,7 +43,7 @@ LAGUNA_M1_FREE_MODEL_ID = "openai/poolside/laguna-m.1:free"
43
  LAGUNA_S21_FREE_MODEL_ID = "openai/poolside/laguna-s-2.1:free"
44
  NEX_N2_MINI_MODEL_ID = "openai/nex-agi/nex-n2-mini"
45
  LING_3_0_FLASH_FREE_MODEL_ID = "openai/inclusionai/ling-3.0-flash:free"
46
- DEEPSEEK_V4_FLASH_LATEST_MODEL_ID = "deepseek/deepseek-v4-flash-latest"
47
  """
48
  if "GEMMA_4_31B_FREE_MODEL_ID" not in content:
49
  content = content.replace(
@@ -125,7 +125,7 @@ new_func = (
125
  ' {"id": MINIMAX_M3_MODEL_ID, "label": "DeepSeek V4 Flash"},\n'
126
  ' {"id": DEFAULT_MODEL_ID, "label": "DeepSeek V4 Flash"},\n'
127
  ' {"id": DEEPSEEK_V4_PRO_MODEL_ID, "label": "Nemotron 3 Super 120B"},\n'
128
- ' {"id": DEEPSEEK_V4_FLASH_LATEST_MODEL_ID, "label": "DeepSeek V4 Flash latest (no tools)"},\n'
129
  " ]\n"
130
  " return models"
131
  )
@@ -190,8 +190,8 @@ if "normalized_model.startswith" not in llm_content:
190
  if api_key_find in llm_content:
191
  line_end = llm_content.find("\n", llm_content.find(api_key_find) + len(api_key_find)) + 1
192
  routing_insert = (
193
- ' # Route openai/-prefixed models to OpenRouter\n'
194
- ' if normalized_model.startswith("openai/"):\n'
195
  ' return {\n'
196
  ' "model": normalized_model,\n'
197
  ' "api_base": "https://openrouter.ai/api/v1",\n'
 
43
  LAGUNA_S21_FREE_MODEL_ID = "openai/poolside/laguna-s-2.1:free"
44
  NEX_N2_MINI_MODEL_ID = "openai/nex-agi/nex-n2-mini"
45
  LING_3_0_FLASH_FREE_MODEL_ID = "openai/inclusionai/ling-3.0-flash:free"
46
+ DEEPSEEK_V4_FLASH_LATEST_MODEL_ID = "~deepseek/deepseek-v4-flash-latest"
47
  """
48
  if "GEMMA_4_31B_FREE_MODEL_ID" not in content:
49
  content = content.replace(
 
125
  ' {"id": MINIMAX_M3_MODEL_ID, "label": "DeepSeek V4 Flash"},\n'
126
  ' {"id": DEFAULT_MODEL_ID, "label": "DeepSeek V4 Flash"},\n'
127
  ' {"id": DEEPSEEK_V4_PRO_MODEL_ID, "label": "Nemotron 3 Super 120B"},\n'
128
+ ' {"id": DEEPSEEK_V4_FLASH_LATEST_MODEL_ID, "label": "DeepSeek V4 Flash latest"},\n'
129
  " ]\n"
130
  " return models"
131
  )
 
190
  if api_key_find in llm_content:
191
  line_end = llm_content.find("\n", llm_content.find(api_key_find) + len(api_key_find)) + 1
192
  routing_insert = (
193
+ ' # Route deepseek/-prefixed models to OpenRouter\n'
194
+ ' if normalized_model.startswith("~deepseek/") or normalized_model.startswith("deepseek/"):\n'
195
  ' return {\n'
196
  ' "model": normalized_model,\n'
197
  ' "api_base": "https://openrouter.ai/api/v1",\n'