---
title: AnythingLLM | RunAPI
description: 安装 AnythingLLM，为 RunAPI 配置 Generic OpenAI provider，设置模型限制并验证 workspace
  chat。
url: https://runapi.ai/zh-CN/docs/resources/application-practices/anythingllm.md
canonical: https://runapi.ai/zh-CN/docs/resources/application-practices/anythingllm
locale: zh-CN
---

> HTML version: https://runapi.ai/zh-CN/docs/resources/application-practices/anythingllm
> Site index for agents: https://runapi.ai/llms.txt

# AnythingLLM

AnythingLLM 为兼容 Chat Completions 的服务提供面向开发者的 **OpenAI (generic)**
provider。开始前，请在[身份验证指南](https://runapi.ai/zh-CN/docs/guides/authentication)创建标准 RunAPI
API Key，并从[模型目录](https://runapi.ai/zh-CN/models)选择 model。

## 安装 AnythingLLM

按照 [AnythingLLM 官方安装指南][1]安装 desktop 或 self-hosted 版本。打开 AnythingLLM
并完成初始设置，再修改 LLM provider。



[1]: https://docs.anythingllm.com/installation-desktop/overview

## 配置 OpenAI (generic)

1.  打开 **Settings → LLM Preference**，选择 **OpenAI (generic)**。
2.  **Base URL** 填写 `https://runapi.ai/v1`。不要追加
    `/chat/completions`，AnythingLLM 会自行添加 operation path。
3.  填写 RunAPI API Key。
4.  在 **Selected Model** 中选择准确的 RunAPI identifier。若 model list
    为空，请从[模型目录](https://runapi.ai/zh-CN/models)复制并手动输入。
5.  按该 model 支持的值设置 **Model context window** 与 **Max Tokens**，然后保存
    provider。

AnythingLLM 使用 **Model context window** 为 system instructions、history 和
user input 分配空间，并将 **Max Tokens** 作为 `max_tokens` 发送。因此这些值必须随所选 model
设置，不能把同一示例值用于所有模型。

## 验证连接

创建或打开一个 workspace，开始 chat 并发送 `只回复 connected。`。收到文本回复，即表示 workspace
正在使用保存的 RunAPI provider 和 Selected Model。

## 排查问题

* **model list 为空：** 确认 Base URL 是 `https://runapi.ai/v1`，然后手动输入当前 model
  identifier。
* **请求因长度被拒绝：** 减少 workspace history，或按所选 model 的当前限制修正 **Model context
  window** 与 **Max Tokens**。
* **身份验证失败：** 在 **OpenAI (generic)**
  中换成[身份验证指南](https://runapi.ai/zh-CN/docs/guides/authentication)提供的有效标准 Key。
* **workspace 仍由其他 model 回复：** 重新打开 **LLM Preference**，确认 **OpenAI
  (generic)** 已启用，并再次保存目标 **Selected Model**。

通用协议行为请查看 [LLM API
快速开始](https://runapi.ai/zh-CN/docs/guides/llm-api/quickstart)。请求和响应字段请查看 [Chat
Completions API 参考](https://runapi.ai/zh-CN/docs/api/openai/chat-completions)。

---

## More from RunAPI

- [Home](https://runapi.ai/.md)
- [模型](https://runapi.ai/zh-CN/models.md)
- [AI 视频 API 对比](https://runapi.ai/zh-CN/ai-video-api-comparison.md)
- [OpenClaw 集成](https://runapi.ai/zh-CN/openclaw.md)
- [OpenClaw 最佳 API](https://runapi.ai/zh-CN/best-api-for-openclaw.md)
- [OpenClaw 图片生成](https://runapi.ai/zh-CN/openclaw-image-generation.md)
- [Hermes 智能体集成](https://runapi.ai/zh-CN/hermes-agent.md)
- [定价](https://runapi.ai/zh-CN/pricing.md)
- [Claude API 定价](https://runapi.ai/zh-CN/claude-api-pricing.md)
- [ChatGPT API 定价](https://runapi.ai/zh-CN/chatgpt-api-pricing.md)
- [OpenAI API 定价](https://runapi.ai/zh-CN/openai-api-pricing.md)
- [Gemini API 定价](https://runapi.ai/zh-CN/gemini-api-pricing.md)
- [Claude Code 定价](https://runapi.ai/zh-CN/claude-code-pricing.md)
- [Claude Code API](https://runapi.ai/zh-CN/claude-code-api.md)
- [Claude Code 对比 Cursor](https://runapi.ai/zh-CN/claude-code-vs-cursor.md)
- [Claude Max 对比 API](https://runapi.ai/zh-CN/claude-max-vs-api.md)
- [Requesty 替代方案](https://runapi.ai/zh-CN/requesty-alternative.md)
- [文档](https://runapi.ai/zh-CN/docs/guides)
- [SDK](https://runapi.ai/zh-CN/sdk.md)
- [Skills](https://runapi.ai/zh-CN/skills.md)
- [MCP Server](https://runapi.ai/zh-CN/mcp.md)
- [CLI](https://runapi.ai/zh-CN/cli.md)
- [反馈](https://runapi.ai/)
- [联系](mailto:support@runapi.ai)
- [服务条款](https://runapi.ai/zh-CN/terms.md)
- [隐私政策](https://runapi.ai/zh-CN/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-CN/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-CNicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "TechArticle",
    "headline": "AnythingLLM",
    "description": "安装 AnythingLLM，为 RunAPI 配置 Generic OpenAI provider，设置模型限制并验证 workspace chat。",
    "url": "https://runapi.ai/zh-CN/docs/resources/application-practices/anythingllm",
    "mainEntityOfPage": "https://runapi.ai/zh-CN/docs/resources/application-practices/anythingllm"
  }
]
```
