Route asr-gpt to official OpenAI with ZenMux backup

This commit is contained in:
Codex
2026-10-28 19:23:58 -07:00
parent df391cd41f
commit 3d44b74d8c
2 changed files with 16 additions and 0 deletions
+10
View File
@@ -14,10 +14,20 @@ class RoutingTests(unittest.TestCase):
routes = {r['model_name']: r['litellm_params'] for r in config['model_list']}
self.assertEqual(routes['openai/gpt-transcribe']['api_base'], 'https://api.openai.com/v1')
self.assertEqual(routes['zenmux/gpt-transcribe']['api_base'], 'https://zenmux.ai/api/v1')
self.assertEqual(routes['asr-gpt'], routes['openai/gpt-transcribe'])
self.assertIn({'asr-gpt': ['zenmux/gpt-transcribe']}, config['router_settings']['fallbacks'])
self.assertEqual(routes['openai/gpt-sol-latest']['model'], 'openai/gpt-6.1-sol')
self.assertNotIn('codex/gpt-sol-latest', routes)
self.assertNotIn('synthetic', yaml.safe_dump(config))
def test_official_asr_without_zenmux_has_no_dangling_fallback(self):
catalog = yaml.safe_load(Path(__file__).with_name('models.yaml').read_text())
config = build_hk_config(catalog, {'OPENAI_API_KEY': 'synthetic'})
routes = {r['model_name']: r['litellm_params'] for r in config['model_list']}
self.assertEqual(routes['asr-gpt']['model'], 'openai/gpt-transcribe')
self.assertNotIn('zenmux/gpt-transcribe', routes)
self.assertNotIn({'asr-gpt': ['zenmux/gpt-transcribe']}, config['router_settings']['fallbacks'])
def test_bailian_personal_uses_hk_private_vocabulary(self):
catalog = yaml.safe_load(Path(__file__).with_name('models.yaml').read_text())
routes = build_hk_config(catalog, {'BAILIAN_CN_API_KEY':'synthetic',