16 lines
1.1 KiB
SQL
16 lines
1.1 KiB
SQL
insert into channels (type,key,status,name,weight,created_time,test_time,response_time,base_url,other,balance,balance_updated_time,models,"group",used_quota,model_mapping,status_code_mapping,priority,auto_ban,other_info,tag,setting,param_override,header_override)
|
|
select 1,'none',1,'speka-pool',0,extract(epoch from now())::bigint,0,0,'http://127.0.0.1:8819','',0,0,
|
|
'speka-muse-glimmer,speka-nemotron-ultra,speka-laguna-xs,speka-bolt,speka-lightning,speka-step5,speka-llama-vision',
|
|
'default,premium,t1,t2,t3,t4',0,'','{"400":429,"401":429,"402":429,"403":429}',50,0,'','speka','','',''
|
|
where not exists (select 1 from channels where name='speka-pool');
|
|
|
|
insert into abilities ("group",model,channel_id,enabled,priority,weight,tag)
|
|
select g.grp, m.model, c.id, true, c.priority, 0, c.tag
|
|
from channels c
|
|
cross join lateral unnest(string_to_array(c."group",',')) g(grp)
|
|
cross join lateral unnest(string_to_array(c.models,',')) m(model)
|
|
where c.name='speka-pool' and trim(m.model) <> ''
|
|
on conflict ("group",model,channel_id) do update set enabled=true;
|
|
|
|
select id,name,status,base_url,priority,"group",tag,models from channels where name='speka-pool';
|