Files
proxycast/docs/content/02.user-guide/4.configuration-example.md
T

3.1 KiB
Raw Blame History

title, description, navigation
title description navigation
进阶配置示例 按创作场景选择配置思路(示例)
icon
i-heroicons-document-text

进阶配置示例

::alert{type="info"} 本页示例用于说明配置思路,不要求你逐字段照抄。具体字段以应用设置界面为准。 ::

示例 1:个人创作者(推荐起步)

目标:少配置、快开始。

profile: "solo-creator"
navigation:
  enabled:
    - agent
    - projects
    - resources
    - image-gen
themes:
  enabled:
    - social-media
    - video
    - novel

适用:自媒体、短视频、小说日更。

示例 2:团队协作

目标:统一入口和主题,降低沟通成本。

profile: "team-content"
navigation:
  enabled:
    - agent
    - projects
    - resources
    - tools
themes:
  enabled:
    - social-media
    - poster
    - document
resource:
  naming: "project-date-version"

适用:品牌运营、活动策划、小团队协作。

示例 3:进阶接入

目标:在保留创作工作台的同时开放 API 给外部工具。

profile: "creator-plus-api"
api_server:
  enabled: true
  host: "127.0.0.1"
  port: 8999
  auth: "api-key"
routing:
  fallback: true

适用:有脚本联动、自动化流程需求的用户。

示例 4:API 缓存策略(高级)

目标:精确控制哪些响应状态码参与短时缓存(非流式)。

server:
  host: "127.0.0.1"
  port: 8999
  api_key: "your-api-key"
  response_cache:
    enabled: true
    ttl_secs: 600
    max_entries: 200
    max_body_bytes: 1048576
    cacheable_status_codes: [200]  # 默认仅缓存 200;可按需扩展 [200, 201]

适用:对缓存命中与语义一致性有要求的自动化/API 调用场景。

示例 5:运行时诊断接口(高级)

目标:像 ClawRouter 一样快速查看网关健康、缓存与统计信息。

# 基础健康检查(兼容旧行为)
curl "http://127.0.0.1:8999/health"

# 扩展健康检查(包含完整诊断)
curl "http://127.0.0.1:8999/health?full=true"

# 响应缓存配置与命中统计
curl "http://127.0.0.1:8999/cache"

# 统计诊断(默认最近 7 天,可传 days=1~30)
curl "http://127.0.0.1:8999/stats?days=7"

# 查看请求级调试头(缓存/去重/幂等等状态)
curl -i "http://127.0.0.1:8999/v1/chat/completions" \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"ping"}]}'

适用:排查“为什么慢/为什么回退/是否命中缓存”等线上联调问题。

可观测调试头示例:

  • x-lime-request-id
  • x-lime-cache(hit/store/skip-*)
  • x-lime-dedup(replay/wait-replay/new/removed-on-error)
  • x-lime-idempotency(replay/in-progress/new/removed-on-error)
  • x-lime-requested-provider / x-lime-effective-provider / x-lime-model

补充:在「团队共享网关(内网)」页面的「网关 API 测试」结果展开区域,也会直接显示这些 x-lime-* 调试头。

调整顺序建议

  1. 先确认导航与主题
  2. 再确认连接与稳定性
  3. 最后再做 API 与自动化扩展