LLM / 对话
概述
Atlas Cloud 通过兼容 OpenAI 的 API 提供对行业领先的大语言模型的访问。如果你已经在使用 OpenAI SDK,只需更改 Base URL 和 API Key——无需其他代码改动。
核心能力
- 文本生成:为任何用例生成连贯、具有上下文感知的内容
- 对话式 AI:构建支持多轮对话的聊天机器人和助手
- 代码生成:生成、审查和调试任何编程语言的代码
- 推理:复杂的逻辑推理、数学运算和问题解决
- 翻译:跨语言理解和生成,支持数十种语言
- 摘要:提取关键信息并生成简洁的摘要
精选模型
| 模型 | 供应商 | 亮点 |
|---|---|---|
| DeepSeek V3 | DeepSeek | 高性能推理和编程,性价比高 |
| Qwen | 阿里巴巴 | 强大的多语言模型系列 |
| Kimi | MoonshotAI | 强大的长文本理解能力 |
| GLM | 智谱 AI | 中英双语模型 |
| MiniMax | MiniMax | 针对多媒体应用优化 |
有关所有 LLM 模型及其规格的完整列表,请访问模型库。
API 集成
Base URL
https://api.atlascloud.ai/v1LLM API 支持流式和非流式两种模式,完全兼容 OpenAI ChatCompletion 格式。
Python(OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://api.atlascloud.ai/v1"
)
# 非流式
response = client.chat.completions.create(
model="deepseek-v3",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
temperature=0.7,
max_tokens=1024
)
print(response.choices[0].message.content)Python(流式)
stream = client.chat.completions.create(
model="deepseek-v3",
messages=[
{"role": "user", "content": "Write a short story about a robot learning to paint."}
],
stream=True
)
for chunk in stream:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)Node.js / TypeScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-api-key",
baseURL: "https://api.atlascloud.ai/v1",
});
// 非流式
const response = await client.chat.completions.create({
model: "deepseek-v3",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Explain quantum computing in simple terms." },
],
});
console.log(response.choices[0].message.content);
// 流式
const stream = await client.chat.completions.create({
model: "deepseek-v3",
messages: [{ role: "user", content: "Tell me a joke." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}cURL
curl https://api.atlascloud.ai/v1/chat/completions \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
"temperature": 0.7,
"max_tokens": 1024
}'常用参数
| 参数 | 类型 | 描述 |
|---|---|---|
model | string | 模型标识符(如 deepseek-v3、qwen-turbo) |
messages | array | 包含 role 和 content 的对话消息 |
temperature | number | 控制随机性(0.0 - 2.0,默认值因模型而异) |
max_tokens | number | 响应的最大 token 数 |
stream | boolean | 启用流式输出 |
top_p | number | 核采样参数 |
配合第三方工具使用
由于 API 兼容 OpenAI,它可以与任何支持自定义 OpenAI 端点的工具配合使用:
| 工具 | 配置方式 |
|---|---|
| Chatbox | 将 API Host 设为 https://api.atlascloud.ai/v1 |
| Cherry Studio | 添加自定义 OpenAI 供应商 |
| OpenWebUI | 配置 OpenAI 兼容端点 |
| LangChain | 使用 ChatOpenAI 并设置自定义 base_url |
| LlamaIndex | 使用 OpenAI 兼容的 LLM 类 |
重要:Base URL 必须包含 /v1 后缀。
模型选择建议
- 性价比:DeepSeek V3 以极具竞争力的价格提供出色的性能
- 多语言:Qwen 在多语言任务上表现出色,尤其是中英双语
- 代码:DeepSeek 是代码生成和审查的强力选择
- 长文本:在模型库上查看每个模型的最大上下文长度
- 推理:选择具有专门推理能力的模型来处理复杂任务