diff --git a/packages/website/AGENTS.md b/packages/website/AGENTS.md index 22dc4b6..16e98db 100644 --- a/packages/website/AGENTS.md +++ b/packages/website/AGENTS.md @@ -85,7 +85,7 @@ Uses wouter browser routing with base path for GitHub Pages deployment at `https ```tsx // main.tsx - + ``` @@ -109,6 +109,7 @@ Instead of `404.html` redirects, the build copies `index.html` into every route 2. Add route in `src/pages/docs/index.tsx` 3. Add navigation item in `src/pages/docs/Layout.tsx` 4. Add path to `SPA_ROUTES` in `vite.config.js` +5. Keep `` consistent across the folder name, import path, route path, sidebar link, and any related cross-links. If the public route changes, rename the folder too. ## Configuration Files diff --git a/packages/website/src/pages/docs/features/models/page.tsx b/packages/website/src/pages/docs/features/models/page.tsx index 53242ec..c27cb87 100644 --- a/packages/website/src/pages/docs/features/models/page.tsx +++ b/packages/website/src/pages/docs/features/models/page.tsx @@ -9,7 +9,6 @@ const BASELINE = new Set([ 'claude-haiku-4.5', 'gemini-3-flash', 'deepseek-3.2', - 'qwen3.6-plus', 'qwen3.5-plus', 'qwen3.5-flash', ]) @@ -23,7 +22,6 @@ const MODEL_GROUPS: Record = { 'qwen3-coder-next', 'qwen-3-max', 'qwen-3-plus', - 'qwen3:14b (ollama)', ], OpenAI: ['gpt-5.4', 'gpt-5.2', 'gpt-5.1', 'gpt-5', 'gpt-5-mini', 'gpt-4.1', 'gpt-4.1-mini'], DeepSeek: ['deepseek-3.2'], @@ -66,7 +64,6 @@ export default function Models() { : 'Supports models that comply with OpenAI API specification and support tool calls, including public cloud services and private deployments.'}

- {/* Models Section */}
{isZh ? '已测试模型' : 'Tested Models'} @@ -89,9 +86,10 @@ export default function Models() {
- {/* Tips Section */}
-

{isZh ? '提示' : 'Tips'}

+ + Tips +
  • @@ -113,7 +111,6 @@ export default function Models() {
- {/* Configuration Section */}
{isZh ? '配置方式' : 'Configuration'}
- {/* Free Testing API Section */} +
+ + {isZh ? '🔐 生产环境鉴权' : '🔐 Production Authentication'} + +

+ {isZh + ? '如果你只是将它用作个人助手,可以直接连接你的 LLM 服务。' + : 'If you only use it as a personal assistant, you can connect to your LLM service directly.'} +

+

+ {isZh ? ( + <> + 如果你计划将它集成到你的 Web 应用中,建议搭建一个后端代理来转发 LLM 请求,并使用{' '} + customFetch 携带 Cookie 或其他鉴权信息: + + ) : ( + <> + If you plan to integrate it into your web app, it's better to have a backend proxy for + the LLM and use customFetch to authenticate the request with cookies or + other methods: + + )} +

+ + fetch(url, { ...init, credentials: 'include' }), +});`} + /> +
+

+ {isZh + ? '⚠️ 永远不要把真实的 LLM API Key 提交到前端代码中' + : '⚠️ NEVER commit real LLM API keys to your frontend code'} +

+
+
+
{isZh ? '免费测试接口' : 'Free Testing API'}

@@ -185,113 +207,141 @@ const pageAgent = new PageAgent({

- {/* Ollama Section */}
- Ollama -

+ {isZh ? '本地运行时' : 'Local Runtimes'} +

{isZh - ? '已在 Ollama 0.15 + qwen3:14b (RTX3090 24GB) 上测试通过。' - : 'Tested on Ollama 0.15 with qwen3:14b (RTX3090 24GB).'} + ? '通过 Ollama、LM Studio 等本地 OpenAI-compatible 运行时接入 PageAgent,实现离线或局域网部署。' + : 'Use local OpenAI-compatible runtimes such as Ollama and LM Studio with PageAgent for offline or LAN deployments.'}

- -
-

- {isZh ? '⚠️ 注意事项' : '⚠️ Important Notes'} -

-
    -
  • - {isZh - ? '确保 OLLAMA_ORIGINS 设置为 * 以避免 403 错误' - : 'Add * to OLLAMA_ORIGINS to avoid 403 errors'} -
  • -
  • - {isZh - ? '小于 10B 参数的模型通常效果不佳' - : 'Models smaller than 10B are unlikely to be strong enough'} -
  • -
  • {isZh ? '需要支持 tool_call 的模型' : 'Requires tool_call capable models'}
  • -
  • - {isZh - ? '确保上下文长度大于输入 token 数,否则 Ollama 会静默截断 prompt。普通页面约需 15k token,随步骤增加。默认 4k 上下文长度无法正常工作' - : 'Ensure context length exceeds input tokens, or Ollama will silently truncate prompts. ~15k tokens for a typical page, increases with steps. Default 4k context length will NOT work'} -
  • -
-
-
-

- {isZh ? '建议启动参数' : 'Recommended Startup'} -

-

- {isZh - ? '启动 Ollama 时建议配置以下环境变量:扩大上下文窗口、允许跨域访问、监听所有网络接口。' - : 'Start Ollama with these environment variables: larger context window, allow cross-origin access, and listen on all interfaces.'} -

+
+
+ + Requirements + +
+
    +
  • + {isZh + ? '务必打开 CORS,否则浏览器无法直接请求本地 LLM 服务。' + : 'Enable CORS, otherwise the browser cannot call your local LLM endpoint directly.'} +
  • +
  • + {isZh + ? '将 context length 或 content length 至少设置为 8000。普通页面常常需要 15k token 左右,默认 4k 很容易被截断。' + : 'Set context length or content length to at least 8000. A typical page often needs around 15k tokens, so the default 4k usually truncates prompts.'} +
  • +
  • + {isZh ? '需要支持 tool_call 的模型。' : 'Use a model with tool_call support.'} +
  • +
  • + {isZh + ? '小于 10B 参数的模型通常效果不佳。' + : 'Models smaller than 10B are usually not strong enough.'} +
  • +
+
+
-
-

macOS / Linux

+
+ + {isZh ? '基础配置' : 'Basic Configuration'} + + code={`// Local OpenAI-compatible runtime - no apiKey needed +const pageAgent = new PageAgent({ + baseURL: 'http://localhost:11434/v1', + model: 'qwen3:14b' +}); -

- Windows (PowerShell) +// Or connect to LM Studio +const lmStudioAgent = new PageAgent({ + baseURL: 'http://127.0.0.1:1234/v1', + model: 'qwen/qwen3.5-27b' +}); +`} + /> +

+ +
+ + Ollama + +

+ {isZh + ? '已在 Ollama 0.15 + qwen3:14b (RTX3090 24GB) 上测试通过。' + : 'Tested on Ollama 0.15 with qwen3:14b (RTX3090 24GB).'}

-
-
-
+
+

+ {isZh ? '⚠️ 注意事项' : '⚠️ Important Notes'} +

+

+ {isZh + ? '如果浏览器侧请求失败,优先检查 Ollama 是否已按上面的要求开启 CORS。' + : 'If browser-side requests fail, check whether Ollama has CORS enabled as required above.'} +

+
- {/* Production Authentication */} -
- - {isZh ? '🔐 生产环境鉴权' : '🔐 Production Authentication'} - -

- {isZh - ? '如果你只是将它用作个人助手,可以直接连接你的 LLM 服务。' - : 'If you only use it as a personal assistant, you can connect to your LLM service directly.'} -

-

- {isZh ? ( - <> - 如果你计划将它集成到你的 Web 应用中,建议搭建一个后端代理来转发 LLM 请求,并使用{' '} - customFetch 携带 Cookie 或其他鉴权信息: - - ) : ( - <> - If you plan to integrate it into your web app, it's better to have a backend proxy for - the LLM and use customFetch to authenticate the request with cookies or - other methods: - - )} -

- - fetch(url, { ...init, credentials: 'include' }), -});`} - /> -
-

- {isZh - ? '⚠️ 永远不要把真实的 LLM API Key 提交到前端代码中' - : '⚠️ NEVER commit real LLM API keys to your frontend code'} -

+
+

+ {isZh ? '建议启动参数' : 'Recommended Startup'} +

+

+ {isZh + ? '启动 Ollama 时建议同时放大上下文窗口并开启跨域访问。' + : 'When starting Ollama, increase the context window and enable cross-origin access.'} +

+ +
+

+ macOS / Linux +

+ + +

+ Windows (PowerShell) +

+ +
+
+
+ +
+ + LM Studio + + +
+

+ {isZh ? '⚠️ 注意事项' : '⚠️ Important Notes'} +

+
    +
  • + {isZh + ? 'Agent 必须启用 disableNamedToolChoice,否则 tool_choice 参数会报错。' + : 'Enable disableNamedToolChoice in the agent config, otherwise the tool_choice parameter may fail.'} +
  • +
+
+
diff --git a/packages/website/src/pages/docs/introduction/troubleshooting/page.tsx b/packages/website/src/pages/docs/introduction/troubleshooting/page.tsx index 2cce548..b846feb 100644 --- a/packages/website/src/pages/docs/introduction/troubleshooting/page.tsx +++ b/packages/website/src/pages/docs/introduction/troubleshooting/page.tsx @@ -274,10 +274,12 @@ function ApiErrorsContent(isZh: boolean) { code={`const agent = new PageAgent({ // ... customFetch: async (url, init) => { - const body = JSON.parse(init.body) // Adapt parameters for your provider - delete body.stream_options - return fetch(url, { ...init, body: JSON.stringify(body) }) + const body = JSON.parse(init.body) + delete body.tool_choice + const bodyStr = JSON.stringify(body) + + return fetch(url, { ...init, body: bodyStr }) }, })`} /> diff --git a/packages/website/src/pages/home/FeaturesSection.tsx b/packages/website/src/pages/home/FeaturesSection.tsx index ab44b16..8e91e7f 100644 --- a/packages/website/src/pages/home/FeaturesSection.tsx +++ b/packages/website/src/pages/home/FeaturesSection.tsx @@ -16,12 +16,13 @@ const LLM_CLOUD: { opacity: number }[] = [ { name: 'OpenAI', color: '#10b981', x: 18, y: 22, size: 1.5, opacity: 1 }, - { name: 'Claude', color: '#f97316', x: 62, y: 15, size: 1.35, opacity: 0.95 }, - { name: 'Qwen', color: '#8b5cf6', x: 38, y: 50, size: 1.8, opacity: 0.9 }, - { name: 'Gemini', color: '#3b82f6', x: 68, y: 48, size: 1.2, opacity: 0.85 }, - { name: 'DeepSeek', color: '#06b6d4', x: 10, y: 65, size: 1.1, opacity: 0.8 }, + { name: 'Claude', color: '#f97316', x: 58, y: 15, size: 1.35, opacity: 0.95 }, + { name: 'Qwen', color: '#8b5cf6', x: 35, y: 50, size: 1.8, opacity: 0.9 }, + { name: 'Gemini', color: '#3b82f6', x: 72, y: 48, size: 1.2, opacity: 0.85 }, + { name: 'DeepSeek', color: '#06b6d4', x: 13, y: 65, size: 1.1, opacity: 0.8 }, { name: 'Grok', color: '#f43f5e', x: 52, y: 78, size: 1.0, opacity: 0.75 }, - { name: 'Ollama', color: '#9ca3af', x: 82, y: 25, size: 1.1, opacity: 0.8 }, + { name: 'Ollama', color: '#9ca3af', x: 84, y: 25, size: 1.1, opacity: 0.8 }, + { name: 'LM Studio', color: '#4338ca', x: 49, y: 36, size: 0.8, opacity: 0.9 }, { name: 'Kimi', color: '#14b8a6', x: 30, y: 82, size: 0.85, opacity: 0.6 }, { name: 'GLM', color: '#f59e0b', x: 70, y: 72, size: 0.85, opacity: 0.55 }, { name: 'LLaMA', color: '#60a5fa', x: 88, y: 70, size: 0.8, opacity: 0.45 }, diff --git a/packages/website/vite.config.js b/packages/website/vite.config.js index 7dd30ee..4001337 100644 --- a/packages/website/vite.config.js +++ b/packages/website/vite.config.js @@ -26,6 +26,7 @@ const SPA_ROUTES = [ 'docs/features/data-masking', 'docs/features/custom-instructions', 'docs/features/models', + 'docs/features/local-llms', 'docs/features/chrome-extension', 'docs/features/mcp-server', 'docs/features/third-party-agent',