Documentation Index
Fetch the complete documentation index at: https://docs.kodus.io/llms.txt
Use this file to discover all available pages before exploring further.
Novita 的工作原理
Novita 是一个面向 AI 的无服务器基础设施平台,旨在以低延迟和降低成本来扩展开源模型。它支持数百个生产就绪的模型——包括 Llama、Mistral、Claude 和 Stable Diffusion——并提供优化的 API、按需 GPU 和自定义模型部署,无需任何 DevOps 开销。推荐模型
我们推荐具有 +100k 上下文窗口的优秀编码模型。如需更新信息,请访问 Novita 官网。
| 模型 | 定价 | 上下文窗口 |
|---|---|---|
Deepseek v3 0324 推荐 | $0.33/1.3 | ~128k 令牌 |
| Deepseek R1 0528 | $0.7/2.5 | ~128k 令牌 |
| Llama 4 Maverick Instruct | $0.17/0.85 | ~100k 令牌 |
创建 API 密钥
直接访问 Novita 的 API 密钥页面创建新的 API 密钥。 或者,按照以下步骤操作:- 进入您的 Novita 控制台
- 点击”Manage API Keys”按钮或进入您的个人资料图片并点击 API Keys
- 点击”Add New Key”并填写’Kodus’或您想要的任何名称
- 点击”Confirm”
- 复制 API 密钥并将其保存在安全的地方
系统要求
推荐硬件
推荐硬件
按默认
local 沙箱模式(kodus-graph + cross-file context 在 worker
容器内运行)调整大小。- CPU: 2+ 核心(约 100k LOC 以上的仓库推荐 4+ 核心)
- RAM: 8GB+(在大型仓库上运行
local沙箱时推荐 16GB) - 存储: 60GB+ 可用空间(Postgres 保存 AST 图缓存; 随仓库数量和 PR 量增长)
必需软件
必需软件
- Docker(最新稳定版)以及 Compose 插件
- 域名或固定 IP(如果您要从云端 Git 提供商 (GitHub.com、GitLab.com 等)接收 webhook)
必需端口
必需端口
默认主机端口映射 — 如果发生冲突,请在
.env 中调整。- 3000 — Kodus Web App
- 3001 — API
- 3332 — Webhooks
- 5432 — PostgreSQL
- 27017 — MongoDB
- 5672, 15672, 15692 — RabbitMQ(AMQP、管理 UI、指标)
- 3101 — MCP Manager (仅当
API_MCP_SERVER_ENABLED=true时)
服务
服务
./scripts/install.sh 根据您的 .env 启动的内容。核心(始终运行):api— 主后端worker— code review 作业webhooks— Git 提供商 webhook 接收器kodus-web— Next.js 前端db_kodus_postgres、db_kodus_mongodb、rabbitmq— 本地基础设施。使用USE_LOCAL_DB=false/USE_LOCAL_RABBITMQ=false跳过以指向托管实例。
kodus-mcp-manager— Model Context Protocol broker。通过API_MCP_SERVER_ENABLED=true启用。请参阅 MCP Manager。worker-analytics— Cockpit 摄取(DORA 指标、PR classifier)。 仅限自托管企业版,默认不连接。请参阅 Analytics Worker。
Code review 使用在沙箱中运行的 AST 图 + cross-file 上下文 —
local(默认,在 worker 内运行)或 e2b(付费远程沙箱)。
有关模式、缓存行为以及何时选择每种模式,请参阅
Sandbox & AST Graph。如果您计划连接云端 Git 服务(GitHub、GitLab、Bitbucket)或云端 LLM 提供商(OpenAI、Anthropic 等),则需要互联网访问。 对于内网自托管的 Git 工具和本地/自托管 LLM,外网访问是可选的。
域名设置(可选)
If you're planning to integrate Kodus with cloud-based Git providers (GitHub, GitLab, or Bitbucket), you'll need public-facing URLs for both the Kodus Web App and its API. This allows your server to receive webhooks for proper Code Review functionality and ensures correct application behavior. We recommend setting up two subdomains:- One for the Web Application, e.g.,
kodus-web.yourdomain.com. - One for the API, e.g.,
kodus-api.yourdomain.com.
- 使用独立的 webhook 子域名,例如
kodus-webhooks.yourdomain.com,或 - 继续使用 API 域名,并在反向代理中将
/github/webhook、/gitlab/webhook等路径转发到 webhook 服务。
Note: If you're only connecting to self-hosted Git tools on your network and do not require public access or webhooks, you might be able to use a simpler setup, but this guide focuses on public-facing deployments.
Setup
Edit the environment file
Success 🎉
When complete, Kodus Services should be running on your machine.
You can verify your installation using the following script:
Access the web interface
Once you access the web interface for the first time, you'll need to:
- Create your admin account - This will be the first user with full system access
- Configure your Git provider - Connect GitHub, GitLab, or Bitbucket following the on-screen instructions
- Select repositories for analysis - Choose which code repositories Kody will review
详细步骤请参见 快速开始指南。
在环境文件中配置 Novita
编辑您的.env 文件并配置核心设置。对于 LLM 集成,在固定模式下使用 Novita:
Webhook URL 必须指向 Webhooks 服务(端口 3332)。您可以使用独立的 webhook 域名,或在反向代理中将
/.../webhook 转发到 3332 端口。固定模式非常适合 Novita,因为它提供兼容 OpenAI 的 API,并且只需要一个 API 密钥。这大大简化了您的设置。
Run the Installation Script
Set the proper permissions for the installation script:What the Installer Does
Our installer automates several important steps:- Verifies Docker installation
- Creates networks for Kodus services
- Clones repositories and configures environment files
- Runs docker-compose to start all services
- Executes database migrations
- Seeds initial data
http://localhost:3000 - you should see the Kodus Web Application interface.
6. 设置反向代理(用于生产环境)
对于 Webhook 和外部访问,配置 Nginx:验证 Novita 集成
除了基本的安装验证外,确认 Novita 正常工作:故障排除
API 密钥问题
API 密钥问题
- 在 Novita 控制台中验证您的 API 密钥是否正确且处于活动状态
- 检查您的 Novita 账户中是否有足够的信用额度
- 确保您的
.env文件中没有多余的空格
模型未找到
模型未找到
- 检查配置中的模型名称拼写是否正确
- 验证该模型在您的 Novita 计划中是否可用
- 尝试使用我们推荐列表中的其他模型
连接错误
连接错误
- 验证您的服务器是否有互联网访问权限以访问
api.novita.ai - 检查是否有任何防火墙限制
- 查看 API/worker 日志以获取详细的错误消息