feat: add domestic model provider presets

This commit is contained in:
Codex Local
2026-08-30 19:55:17 +08:00
parent 522785eda8
commit dcf0fc0d7f
13 changed files with 314 additions and 28 deletions
@@ -0,0 +1,14 @@
BEGIN;
UPDATE content_model_config
SET provider = 'openai_compatible'
WHERE provider NOT IN ('ark', 'openai_compatible');
ALTER TABLE content_model_config
DROP CONSTRAINT content_model_config_provider_check;
ALTER TABLE content_model_config
ADD CONSTRAINT content_model_config_provider_check
CHECK (provider IN ('ark', 'openai_compatible'));
COMMIT;
@@ -0,0 +1,30 @@
BEGIN;
ALTER TABLE content_model_config
DROP CONSTRAINT content_model_config_provider_check;
ALTER TABLE content_model_config
ADD CONSTRAINT content_model_config_provider_check CHECK (provider IN (
'ark',
'dashscope',
'deepseek',
'moonshot',
'zhipu',
'qianfan',
'hunyuan',
'minimax',
'baichuan',
'siliconflow',
'ollama',
'openai_compatible'
));
-- Classify local Ollama records created before provider-specific options were
-- available. This changes only the label/transport capability profile; the
-- encrypted credential, activation state and model identity stay untouched.
UPDATE content_model_config
SET provider = 'ollama'
WHERE provider = 'openai_compatible'
AND base_url ~* '^http://(ollama|localhost|127\.0\.0\.1)(:[0-9]+)?(/|$)';
COMMIT;