feat(providers): OpenAI-compatible provider types as runtime data (providers.yaml)

Replace the five copy-paste OpenAI-compatible provider structs (moonshot,
moonshot_code, deepseek, zai, lm_studio) with one DeclaredProvider engine
driven by a providers.yaml catalog loaded at boot from the cwd — edit and
restart, no rebuild. The YAML carries identity, endpoints, per-model JSON
field mapping, id-glob enrichment rules and the reasoning knob (effort /
thinking request kinds); capability_flags keep vision and future input
modalities declarative. Anthropic, Ollama, OpenAI and OpenRouter stay
native (different wire protocols or bespoke parsing) and register
alongside; colliding declared ids are skipped. The shipped catalog is
validated by a unit test.
This commit is contained in:
2026-07-18 16:19:05 +01:00
parent 760dae06e5
commit 4fea04c57f
11 changed files with 1005 additions and 543 deletions
Generated
+1
View File
@@ -5530,6 +5530,7 @@ dependencies = [
"reqwest 0.13.4",
"serde",
"serde_json",
"serde_yaml",
"sha2 0.10.9",
"sqlx",
"subtle",