- 将 Provider 下游配置由单个 target_format 扩展为多个 target_formats - 保留旧字段 target_format 的启动期迁移逻辑,并标注为弃用兼容代码 - 收敛对外配置与接口返回,Provider 相关响应及 /v1/models 仅暴露 target_formats - 前端 Provider 表单改为多选下游,支持互斥项自动替换 - 新建 Provider 默认选中 openai_chat、codex、claude_chat - 更新示例配置、README、4+1 架构文档及相关测试
119 lines
3.0 KiB
YAML
119 lines
3.0 KiB
YAML
server:
|
|
port: 8080
|
|
host: 127.0.0.1
|
|
|
|
chat:
|
|
whitelist_enabled: false
|
|
|
|
admin:
|
|
username: admin
|
|
password: admin
|
|
|
|
auth_groups:
|
|
- name: openai-shared
|
|
strategy: least_inflight
|
|
cooldown_seconds_on_429: 60
|
|
entries:
|
|
- id: openai-key-a
|
|
enabled: true
|
|
headers:
|
|
Authorization: Bearer sk-your-openai-key-a
|
|
max_concurrency: 3
|
|
cooldown_seconds_on_429: 120
|
|
request_quota_per_minute: 60
|
|
request_quota_per_day: 3000
|
|
token_quota_per_minute: 120000
|
|
token_quota_per_day: 5000000
|
|
- id: openai-key-b
|
|
enabled: true
|
|
headers:
|
|
Authorization: Bearer sk-your-openai-key-b
|
|
max_concurrency: 2
|
|
|
|
providers:
|
|
- name: openai-chat
|
|
# enabled: true # optional, defaults to true; disabled providers are hidden from /v1/models
|
|
api: https://api.openai.com/v1/chat/completions
|
|
transport: http
|
|
source_format: openai_chat
|
|
target_formats:
|
|
- openai_chat
|
|
auth_group: openai-shared
|
|
verify_ssl: true
|
|
timeout_seconds: 1200
|
|
max_retries: 3
|
|
model_list:
|
|
- gpt-4.1
|
|
- gpt-4.1-mini
|
|
hook: example_hook.py
|
|
|
|
- name: responses-upstream
|
|
api: https://api.openai.com/v1/responses
|
|
transport: http
|
|
source_format: openai_responses
|
|
target_formats:
|
|
- openai_chat
|
|
auth_group: openai-shared
|
|
verify_ssl: true
|
|
timeout_seconds: 1200
|
|
max_retries: 3
|
|
model_list:
|
|
- gpt-4.1
|
|
|
|
- name: claude-messages
|
|
api: https://api.anthropic.com/v1/messages
|
|
transport: http
|
|
source_format: claude_chat
|
|
target_formats:
|
|
- claude_chat
|
|
api_key: sk-ant-your-anthropic-key
|
|
verify_ssl: true
|
|
timeout_seconds: 1200
|
|
max_retries: 3
|
|
model_list:
|
|
- claude-sonnet-4-5
|
|
|
|
- name: codex
|
|
api: https://api.openai.com/v1/responses
|
|
transport: http
|
|
source_format: codex
|
|
target_formats:
|
|
- codex
|
|
api_key: sk-your-openai-key
|
|
verify_ssl: true
|
|
timeout_seconds: 1200
|
|
max_retries: 3
|
|
model_list:
|
|
- gpt-5-codex
|
|
|
|
# OpenCode / Cherry Studio (OpenAI provider) commonly use:
|
|
# target_formats:
|
|
# - openai_chat
|
|
#
|
|
# Claude Code / Cherry Studio (Anthropic provider) commonly use:
|
|
# target_formats:
|
|
# - claude_chat
|
|
#
|
|
# Codex commonly uses:
|
|
# target_formats:
|
|
# - codex
|
|
#
|
|
# A single provider can expose multiple downstream formats, for example:
|
|
# target_formats:
|
|
# - openai_chat
|
|
# - claude_chat
|
|
#
|
|
# openai_responses and codex are mutually exclusive in the same provider.
|
|
#
|
|
# Common upstream choices:
|
|
# /v1/chat/completions -> source_format: openai_chat
|
|
# /v1/responses -> source_format: openai_responses
|
|
# /v1/messages -> source_format: claude_chat
|
|
#
|
|
# There is no public stream_format field.
|
|
# The proxy auto-detects upstream responses internally:
|
|
# HTTP text/event-stream -> SSE JSON
|
|
# WebSocket -> JSON messages
|
|
# application/x-ndjson -> NDJSON
|
|
# other HTTP responses -> non-stream
|