- 8张llm_前缀表(手写幂等DDL): vendor/account/model/api_profile/org_policy/org_quota/user_quota/usage - gateway.py 门禁链: 限流→限额→策略选模型(主备容错)→账号×端点轮转(偏好过滤+余额加权+冷却避让)→预授权-结算 - api_key AES单层加密(非RC4,盐不对称不可解); 限流Redis分钟窗口(db4) fail-open - 双维度记账: 一次调用同行记cost(账号侧)+charge(组织池侧); 充值=recharge行 - CRUD+index.ui 8卡片导航+总览; appcodes字典5组; 设计规范+30测试用例 - 策略即开关: 机构无策略→__LEGACY__走旧llm表(向后兼容零改动)
98 lines
2.3 KiB
JSON
98 lines
2.3 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "llm_org_policy",
|
|
"title": "组织模型容错策略",
|
|
"primary": [
|
|
"id"
|
|
],
|
|
"catelog": "entity"
|
|
}
|
|
],
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"title": "主键ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "org_id",
|
|
"title": "机构ID",
|
|
"type": "str",
|
|
"length": 32,
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "primary_model_id",
|
|
"title": "主模型ID",
|
|
"type": "str",
|
|
"length": 32
|
|
},
|
|
{
|
|
"name": "backup_model_ids",
|
|
"title": "备模型ID列表(JSON)",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"name": "endpoint_pref",
|
|
"title": "端点偏好",
|
|
"type": "str",
|
|
"length": 20,
|
|
"nullable": "no",
|
|
"default": "'any'"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"title": "状态",
|
|
"type": "str",
|
|
"length": 20,
|
|
"nullable": "no",
|
|
"default": "'active'"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"title": "创建时间",
|
|
"type": "timestamp",
|
|
"nullable": "no"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"title": "更新时间",
|
|
"type": "timestamp"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "uk_llm_org_policy_org",
|
|
"idxtype": "unique",
|
|
"idxfields": [
|
|
"org_id"
|
|
]
|
|
}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "primary_model_id",
|
|
"table": "llm_model",
|
|
"valuefield": "id",
|
|
"textfield": "name"
|
|
},
|
|
{
|
|
"field": "endpoint_pref",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='llm_endpoint_pref'"
|
|
},
|
|
{
|
|
"field": "status",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='llm_status'"
|
|
}
|
|
]
|
|
}
|