import CodeEditor from '@/components/CodeEditor'
import { useLanguage } from '@/i18n/context'
// Recommended models: lightweight with excellent tool call capabilities
const MODELS = {
recommended: [
'gpt-4.1-mini',
'claude-haiku-4.5',
'gemini-3-flash',
'deepseek-3.2',
'gpt-5.2',
'qwen-3-max',
],
verified: [
'qwen-3-plus',
'gpt-4.1',
'gpt-5',
'gpt-5-mini',
'grok-4',
'grok-code-fast',
'claude-sonnet-3.5',
'claude-sonnet-4.5',
'claude-opus-4.5',
'gemini-2.5',
'gemini-3-pro',
],
}
export default function Models() {
const { isZh } = useLanguage()
const allModels = [...MODELS.recommended, ...MODELS.verified]
return (
{isZh ? '模型' : 'Models'}
{isZh
? '当前支持符合 OpenAI 接口规范且支持 tool call 的模型,包括公有云服务和私有部署方案。'
: 'Supports models that comply with OpenAI API specification and support tool calls, including public cloud services and private deployments.'}
{/* Models Section */}
{isZh ? '已测试模型' : 'Tested Models'}
{isZh
? '推荐使用 ToolCall 能力强的轻量级模型。'
: 'Recommended: Lightweight models with strong ToolCall capabilities.'}
{allModels.map((model) => {
const isRecommended = MODELS.recommended.includes(model)
return (
{model}
{isRecommended && ⭐}
)
})}
⭐ baseline models
{/* Tips Section */}
{isZh ? '提示' : 'Tips'}
-
{isZh
? 'ToolCall 能力较弱的模型可能返回错误的格式,常见错误能够自动恢复,建议设置较高的 temperature'
: 'Models with weaker ToolCall capabilities may return incorrect formats. Common errors usually auto-recover. Higher temperature recommended'}
-
{isZh
? '小模型或者无法适应复杂 Tool 定义的模型,通常效果不佳'
: 'Small models or those unable to handle complex tool definitions typically perform poorly'}
{/* Security Section */}
{isZh ? '🔐 生产环境鉴权建议' : '🔐 Production Authentication'}
{isZh
? '⚠️ 永远不要把真实的 LLM API Key 发布到前端代码'
: '⚠️ Never commit real LLM API Keys to your frontend code'}
{isZh ? '后端代理转发' : 'Backend Proxy Pattern'}
{isZh
? '在后端搭建一个 LLM 流量转发接口,该接口使用与你网站上其他接口相同的鉴权方式,例如:'
: 'Set up a backend LLM proxy endpoint that uses the same authentication method as other APIs in your website, such as:'}
- {isZh ? '• Session/Cookie 会话认证' : '• Session/Cookie-based authentication'}
-
{isZh ? '• OIDC (OpenID Connect) 单点登录' : '• OIDC (OpenID Connect) single sign-on'}
-
{isZh ? '• 临时 Access Key 或 JWT Token' : '• Temporary Access Key or JWT Token'}
{/* Configuration Section */}
{isZh ? '配置方式' : 'Configuration'}
{/* Ollama Section */}
Ollama
{isZh
? '已在 Ollama 0.15 + qwen3:14b (RTX3090 24GB) 上测试通过。'
: 'Tested on Ollama 0.15 with qwen3:14b (RTX3090 24GB).'}
{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'}
-
$env:OLLAMA_CONTEXT_LENGTH=64000; ollama serve
)
}