Skip to content

Commit e09f846

Browse files
docs: Update docs
Signed-off-by: yangchuansheng <[email protected]>
1 parent 0ee9941 commit e09f846

File tree

192 files changed

+6806
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+6806
-48
lines changed

.github/workflows/build-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
with:
5757
context: .
5858
file: ./Dockerfile
59-
platforms: linux/amd64,linux/arm64
59+
platforms: linux/amd64
6060
push: true
6161
tags: ${{ steps.meta.outputs.tags }}
6262
labels: ${{ steps.meta.outputs.labels }}

content/docs/advanced/architecture.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ The Container-shim layer provides automated maintenance:
4747
- Automatically cleans up redundant data
4848
- Optimizes image size and layer count for optimal system performance
4949

50-
![](./images/shim_arch.png)
50+
![](./images/shim_arch.png)

content/docs/advanced/architecture.zh-cn.mdx

+31-28
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
---
2-
title: Architecture
2+
title: Devbox 架构
33
---
44

5-
Sealos Devbox is an advanced development environment solution that leverages cloud-native Container and Kubernetes technologies to offer a unified and flexible development Runtime. Its key feature is simulating a traditional virtual machine experience while maintaining containerization benefits.
5+
Sealos Devbox 是一种先进的开发环境解决方案,它利用云原生容器和 Kubernetes 技术提供统一且灵活的开发运行时。其核心特点是在保持容器化优势的同时,模拟传统虚拟机体验。
66

7-
## Architecture
7+
## 架构
88

9-
Sealos Devbox is built on a layered architecture, comprising these key components:
9+
Sealos Devbox 基于分层架构设计,包含以下关键组件:
1010

11-
![](./images/architecture.zh-cn.png)
11+
![](./images/architecture.png)
1212

1313

14-
## Control Flow
14+
## 控制流程
1515

16-
Devbox implements a decoupled front-end and back-end design:
16+
Devbox 实现了前后端解耦设计:
1717

18-
1. Users trigger actions via the web interface or plugins
19-
2. Devbox Controller receives and processes these requests
20-
3. Controller translates the processed instructions into Kubernetes API calls
21-
4. Kubernetes executes the corresponding Container operations
18+
1. 用户通过网页界面或插件触发操作
19+
2. Devbox 控制器接收并处理这些请求
20+
3. 控制器将处理后的指令转换为 Kubernetes API 调用
21+
4. Kubernetes 执行相应的容器操作
2222

23-
![](./images/controller_flow.zh-cn.png)
23+
![](./images/controller_flow.png)
2424

2525

26+
## 状态持久化机制
2627

27-
## State Persistence Mechanism
28+
Devbox 采用智能状态保存系统,确保用户环境的一致性:
2829

29-
Devbox employs an intelligent state preservation system to maintain user environment consistency:
30+
### 自动保存
3031

31-
### Automatic Saving
32+
- 系统在特定条件下自动保存用户环境变更
33+
- 变更被打包为镜像层
34+
- 新的镜像层作为提交附加到基础镜像上
35+
- 更新后的镜像安全地存储在隔离的内部镜像仓库中
3236

33-
- System auto-saves user environment changes under specific conditions
34-
- Changes are packaged as image layers
35-
- New layers are appended to the base image as commits
36-
- Updated images are securely stored in an isolated internal registry
37+
### 环境恢复
3738

38-
### Environment Recovery
39+
- 在后续启动时,系统从最新镜像启动
40+
- 确保完整保留历史变更
3941

40-
- On subsequent startups, system boots from the most recent image
41-
- Ensures full preservation of historical changes
42+
### 优化
43+
44+
Container-shim 层提供自动化维护:
45+
46+
- 定期合并镜像层以优化存储
47+
- 自动清理冗余数据
48+
- 优化镜像大小和层数,实现系统最佳性能
49+
50+
![](./images/shim_arch.png)
4251

43-
### Optimization
4452

45-
The Container-shim layer provides automated maintenance:
46-
- Regularly merges image layers to optimize storage
47-
- Automatically cleans up redundant data
48-
- Optimizes image size and layer count for optimal system performance
4953

50-
![](./images/shim_arch.zh-cn.png)

content/docs/guides/ai-proxy.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: AI Proxy
3+
description: AI Proxy 是 Sealos 平台提供的统一 AI 模型调用服务,支持多平台 API Key 管理、统一计费和监控,让开发者轻松接入各类 AI 模型。
4+
keywords: ["AI Proxy", "Sealos", "AI模型调用", "API管理", "统一计费", "开发者工具"]
5+
---
+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
title: AI Proxy
3+
description: AI Proxy 是 Sealos 平台提供的统一 AI 模型调用服务,支持多平台 API Key 管理、统一计费和监控,让开发者轻松接入各类 AI 模型。
4+
keywords: ["AI Proxy", "Sealos", "AI模型调用", "API管理", "统一计费", "开发者工具"]
5+
---
6+
7+
## 简介
8+
9+
AI Proxy 是 Sealos 平台提供的一站式 AI 模型调用解决方案,让开发者能够在统一的平台中轻松调用和管理各类 AI 模型。无论是通义千问、文心一言还是其他 AI 模型,都可以通过统一的接口进行调用。
10+
11+
### 为什么选择 AI Proxy?
12+
13+
- 🔑 **一键获取多平台密钥** - 无需分别注册各个 AI 平台
14+
- 💰 **统一计费更省心** - 告别多平台充值的烦恼
15+
- 📊 **集中管理更高效** - 一站式监控所有模型调用情况
16+
17+
## 功能特点
18+
19+
### 统一的 API 访问
20+
21+
- 提供标准化的 API 接口,支持多家主流 AI 模型厂商
22+
- 兼容 OpenAI API 格式,便于快速迁移和集成
23+
- 持续扩充支持的模型类型
24+
25+
### 简化的密钥管理
26+
27+
![密钥管理界面](./images/ai-proxy-key-management.png)
28+
29+
- 一键获取多平台 API Key
30+
- 无需分别注册各个 AI 平台
31+
- 统一的密钥管理界面
32+
33+
### 集中化计费与监控
34+
35+
![计费系统界面](./images/ai-proxy-billing.png)
36+
37+
- 使用 Sealos 平台统一结算
38+
- 透明的按量计费模式
39+
- 详细的费用明细和账单查询
40+
- 详细的调用日志记录
41+
42+
## 快速开始
43+
44+
### 获取 API Key
45+
46+
1. 访问 [Sealos Cloud](https://cloud.sealos.run)
47+
2. 打开 AI Proxy 应用
48+
3. 点击【新建】按钮创建新的 API Key
49+
4. 复制生成的 API Endpoint 和 API Key
50+
51+
### API 调用示例
52+
53+
#### 使用 JavaScript 调用
54+
55+
```javascript
56+
async function main() {
57+
const apiKey = 'your-api-key'
58+
const apiUrl = 'https://aiproxy.hzh.sealos.run/v1/chat/completions'
59+
60+
const response = await fetch(apiUrl, {
61+
method: 'POST',
62+
headers: {
63+
'Content-Type': 'application/json',
64+
'Authorization': `Bearer ${apiKey}`
65+
},
66+
body: JSON.stringify({
67+
model: 'Doubao-lite-4k',
68+
messages: [
69+
{ role: 'system', content: 'You are a helpful assistant.' },
70+
{ role: 'user', content: '你好,请介绍一下你自己。' }
71+
],
72+
max_tokens: 2048,
73+
temperature: 0.7,
74+
}),
75+
})
76+
77+
const data = await response.json()
78+
console.log(data.choices[0].message.content)
79+
}
80+
```
81+
82+
### 请求参数说明
83+
84+
| 参数 | 类型 | 说明 | 示例值 |
85+
|------|------|------|--------|
86+
| model | string | 要使用的模型名称 | Doubao-lite-4k |
87+
| messages | array | 对话消息列表 | `[{"role": "user"}]` |
88+
| max_tokens | number | 最大生成的 token 数量 | 2048 |
89+
| temperature | number | 生成文本的随机性,范围 0-1 | 0.7 |
90+
91+
## 费用管理
92+
93+
### 查看费用明细
94+
95+
1. 在 AI Proxy 界面中点击【费用明细】
96+
2. 可查看各模型的调用次数和费用统计
97+
3. 支持按时间范围筛选费用记录
98+
99+
### 余额充值
100+
101+
1. 进入 Sealos 费用中心
102+
2. 选择充值金额
103+
3. 完成支付后即可使用充值金额调用模型
104+
105+
## 调用日志
106+
107+
### 日志查看
108+
109+
- 支持查看详细的 API 调用记录
110+
- 包含调用时间、模型名称、输入输出 token 数量等信息
111+
112+
### 日志筛选
113+
114+
- 按时间范围筛选
115+
- 按模型类型筛选
116+
- 按 Token 筛选
117+
118+
## 最佳实践
119+
120+
### 开发建议
121+
122+
1. 合理设置 `max_tokens` 参数,避免生成过长的无效内容
123+
2. 根据场景调整 `temperature` 参数,对话场景建议使用较高的值
124+
3. 在生产环境中做好异常处理和重试机制
125+
126+
### 成本优化
127+
128+
1. 选择适合业务场景的模型
129+
2. 合理设置上下文长度,避免无效的 token 消耗
130+
131+
## 常见问题
132+
133+
### API 调用失败
134+
135+
- 检查 API Key 是否正确
136+
- 确认账户余额是否充足
137+
- 查看具体的错误信息进行排查
138+
139+
### 费用相关
140+
141+
- 费用按实际调用量计费
142+
- 不同模型的计费标准不同
143+
- 支持查看详细的计费规则
Loading
Loading

content/docs/guides/meta.zh-cn.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"title": "指南",
3-
"pages": ["fundamentals", "databases", "app-store", "app-launchpad", "cronjob", "object-storage"]
3+
"pages": ["fundamentals", "databases", "app-store", "app-launchpad", "cronjob", "ai-proxy", "object-storage"]
44
}

content/docs/k8s/QA.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "常见问题"
3+
keywords: [Sealos, 镜像构建, Kubernetes运行时, 版本兼容性, 文件目录位置]
4+
description: 了解Sealos常见问题及解决方案,包括镜像构建、Kubernetes运行时选择、版本兼容性和文件目录位置调整。
5+
---

0 commit comments

Comments
 (0)