import{_ as i,c as a,o as t,ah as n}from"./chunks/framework.BJEpWshW.js";const E=JSON.parse('{"title":"配置文件概览、","description":"","frontmatter":{},"headers":[],"relativePath":"config/overview.md","filePath":"config/overview.md"}'),e={name:"config/overview.md"};function l(h,s,d,p,k,r){return t(),a("div",null,[...s[0]||(s[0]=[n(`<h1 id="配置文件概览、" tabindex="-1">配置文件概览、 <a class="header-anchor" href="#配置文件概览、" aria-label="Permalink to “配置文件概览、”">​</a></h1><p>WebAI2API 使用 YAML 格式的配置文件 <code>config.yaml</code> 进行配置。</p><div class="warning custom-block"><p class="custom-block-title">注意</p><p>项目的配置问价已可以完全使用 WebUI 进行配置，若您不了解 YAML 文件，请直接略过该板块访问 WebUI 修改配置！</p></div><h2 id="配置文件结构" tabindex="-1">配置文件结构 <a class="header-anchor" href="#配置文件结构" aria-label="Permalink to “配置文件结构”">​</a></h2><div class="language-yaml"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 日志等级</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">logLevel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">info</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 服务器配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">server</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  port</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3000</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  auth</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">sk-your-key</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  keepalive</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    mode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;comment&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 后端配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">backend</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  pool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    strategy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">least_busy</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    failover</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      maxRetries</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    instances</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;browser_default&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">        workers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">          - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;default&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">            type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">lmarena</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  adapter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    gemini_biz</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      entryUrl</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 队列配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">queue</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  queueBuffer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  imageLimit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 浏览器配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">browser</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  path</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  headless</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  proxy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span></span></code></pre></div><h2 id="配置项说明" tabindex="-1">配置项说明 <a class="header-anchor" href="#配置项说明" aria-label="Permalink to “配置项说明”">​</a></h2><h3 id="日志配置" tabindex="-1">日志配置 <a class="header-anchor" href="#日志配置" aria-label="Permalink to “日志配置”">​</a></h3><table tabindex="0"><thead><tr><th>配置项</th><th>类型</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><code>logLevel</code></td><td>string</td><td><code>info</code></td><td>日志等级：<code>debug</code>、<code>info</code>、<code>warn</code>、<code>error</code></td></tr></tbody></table><h3 id="服务器配置-server" tabindex="-1">服务器配置 (server) <a class="header-anchor" href="#服务器配置-server" aria-label="Permalink to “服务器配置 (server)”">​</a></h3><table tabindex="0"><thead><tr><th>配置项</th><th>类型</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><code>port</code></td><td>number</td><td><code>3000</code></td><td>HTTP 服务监听端口</td></tr><tr><td><code>auth</code></td><td>string</td><td>-</td><td>API 鉴权 Token (Bearer Token)</td></tr><tr><td><code>keepalive.mode</code></td><td>string</td><td><code>comment</code></td><td>心跳模式：<code>comment</code> 或 <code>content</code></td></tr></tbody></table><div class="tip custom-block"><p class="custom-block-title">心跳模式说明</p><ul><li><strong>comment</strong>: 发送 <code>:keepalive</code> 注释，不污染数据（推荐）</li><li><strong>content</strong>: 发送空 delta，用于必须收到 JSON 才重置超时的客户端</li></ul></div><h3 id="队列配置-queue" tabindex="-1">队列配置 (queue) <a class="header-anchor" href="#队列配置-queue" aria-label="Permalink to “队列配置 (queue)”">​</a></h3><table tabindex="0"><thead><tr><th>配置项</th><th>类型</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><code>queueBuffer</code></td><td>number</td><td><code>2</code></td><td>非流式请求的额外排队数，0 表示不限制</td></tr><tr><td><code>imageLimit</code></td><td>number</td><td><code>5</code></td><td>单次请求最大图片数量 (最大 10)</td></tr></tbody></table><h3 id="浏览器配置-browser" tabindex="-1">浏览器配置 (browser) <a class="header-anchor" href="#浏览器配置-browser" aria-label="Permalink to “浏览器配置 (browser)”">​</a></h3><table tabindex="0"><thead><tr><th>配置项</th><th>类型</th><th>默认值</th><th>说明</th></tr></thead><tbody><tr><td><code>path</code></td><td>string</td><td><code>&quot;&quot;</code></td><td>Camoufox 可执行文件路径，留空使用默认</td></tr><tr><td><code>headless</code></td><td>boolean</td><td><code>false</code></td><td>是否启用无头模式</td></tr><tr><td><code>proxy</code></td><td>object</td><td>-</td><td>全局代理配置</td></tr></tbody></table><h2 id="相关文档" tabindex="-1">相关文档 <a class="header-anchor" href="#相关文档" aria-label="Permalink to “相关文档”">​</a></h2><ul><li><a href="/config/instances.html">实例配置</a> - 浏览器实例和 Worker 详细配置</li><li><a href="/config/proxy.html">代理设置</a> - 代理配置详解</li></ul>`,17)])])}const c=i(e,[["render",l]]);export{E as __pageData,c as default};
