Add benchmark-driven model promotion workflow and pipeline stages
Some checks failed
ci / test-and-build (push) Has been cancelled
Some checks failed
ci / test-and-build (push) Has been cancelled
This commit is contained in:
parent
98b13d1069
commit
8c1f7c1e13
38 changed files with 5300 additions and 503 deletions
|
|
@ -23,37 +23,20 @@ class ConfigUiRuntimeModeTests(unittest.TestCase):
|
|||
|
||||
def test_infer_runtime_mode_detects_expert_overrides(self):
|
||||
cfg = Config()
|
||||
cfg.llm.provider = "external_api"
|
||||
cfg.external_api.enabled = True
|
||||
cfg.models.allow_custom_models = True
|
||||
self.assertEqual(infer_runtime_mode(cfg), RUNTIME_MODE_EXPERT)
|
||||
|
||||
def test_apply_canonical_runtime_defaults_resets_expert_fields(self):
|
||||
cfg = Config()
|
||||
cfg.stt.provider = "local_whisper"
|
||||
cfg.llm.provider = "external_api"
|
||||
cfg.external_api.enabled = True
|
||||
cfg.external_api.base_url = "https://example.local/v1"
|
||||
cfg.external_api.model = "custom-model"
|
||||
cfg.external_api.api_key_env_var = "CUSTOM_KEY"
|
||||
cfg.external_api.timeout_ms = 321
|
||||
cfg.external_api.max_retries = 8
|
||||
cfg.models.allow_custom_models = True
|
||||
cfg.models.whisper_model_path = "/tmp/custom-whisper.bin"
|
||||
cfg.models.llm_model_path = "/tmp/custom-model.gguf"
|
||||
|
||||
apply_canonical_runtime_defaults(cfg)
|
||||
|
||||
self.assertEqual(cfg.stt.provider, "local_whisper")
|
||||
self.assertEqual(cfg.llm.provider, "local_llama")
|
||||
self.assertFalse(cfg.external_api.enabled)
|
||||
self.assertEqual(cfg.external_api.base_url, "https://api.openai.com/v1")
|
||||
self.assertEqual(cfg.external_api.model, "gpt-4o-mini")
|
||||
self.assertEqual(cfg.external_api.api_key_env_var, "AMAN_EXTERNAL_API_KEY")
|
||||
self.assertEqual(cfg.external_api.timeout_ms, 15000)
|
||||
self.assertEqual(cfg.external_api.max_retries, 2)
|
||||
self.assertFalse(cfg.models.allow_custom_models)
|
||||
self.assertEqual(cfg.models.whisper_model_path, "")
|
||||
self.assertEqual(cfg.models.llm_model_path, "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue