1774673562
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
```
|
||||
{
|
||||
"model": "deepseek-chat",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "北京现在的天气怎么样?"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "get_weather",
|
||||
"description": "获取指定城市的天气信息",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"city": {
|
||||
"type": "string",
|
||||
"description": "城市名称"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"city"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tool_choice": "auto"
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
"id": "06bcc2b7-602a-474b-bdd3-01cea249b121",
|
||||
"object": "chat.completion",
|
||||
"created": 1774519072,
|
||||
"model": "deepseek-chat",
|
||||
"choices": [
|
||||
{
|
||||
"index": 0,
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "我来帮您查询北京的天气情况。",
|
||||
"tool_calls": [
|
||||
{
|
||||
"index": 0,
|
||||
"id": "call_00_s4Qs5fJiG0yeRTpOgYxnxRyp",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "get_weather",
|
||||
"arguments": "{\"city\": \"北京\"}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"logprobs": null,
|
||||
"finish_reason": "tool_calls"
|
||||
}
|
||||
],
|
||||
"usage": {
|
||||
"prompt_tokens": 309,
|
||||
"completion_tokens": 51,
|
||||
"total_tokens": 360,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
},
|
||||
"prompt_cache_hit_tokens": 0,
|
||||
"prompt_cache_miss_tokens": 309
|
||||
},
|
||||
"system_fingerprint": "fp_eaab8d114b_prod0820_fp8_kvcache_new_kvcache"
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
{
|
||||
"model": "deepseek-chat",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "给我返回一个水果的信息,包含名称和颜色"
|
||||
}
|
||||
],
|
||||
"response_format": {
|
||||
"type": "json_schema",
|
||||
"json_schema": {
|
||||
"name": "fruit",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "水果名称"
|
||||
},
|
||||
"color": {
|
||||
"type": "string",
|
||||
"description": "水果颜色"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"color"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
{
|
||||
"id": "chatcmpl-2b2225c5-02d0-4817-8039-329b3c790128",
|
||||
"object": "chat.completion",
|
||||
"created": 1774519551,
|
||||
"model": "gpt-5.4",
|
||||
"choices": [
|
||||
{
|
||||
"index": 0,
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "{\"color\":\"红色\",\"name\":\"苹果\"}"
|
||||
},
|
||||
"finish_reason": "stop"
|
||||
}
|
||||
],
|
||||
"usage": {
|
||||
"prompt_tokens": 80,
|
||||
"completion_tokens": 17,
|
||||
"total_tokens": 97,
|
||||
"prompt_tokens_details": {},
|
||||
"completion_tokens_details": {
|
||||
"reasoning_tokens": 0,
|
||||
"accepted_prediction_tokens": 0,
|
||||
"rejected_prediction_tokens": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,40 @@
|
||||
# 常用 Screen 命令大全
|
||||
|
||||
## 创建会话(最常用)
|
||||
|
||||
- `screen -U -S vllm_server` → 新建并命名
|
||||
- `screen -U -dmS vllm_server` → **新建后立即分离**(最推荐!直接后台启动)
|
||||
- `screen -U -dmS vllm_server "python -m vllm serve …"` → 新建 + 直接执行命令(一键启动服务)
|
||||
|
||||
## 管理会话
|
||||
|
||||
- `screen -U -ls` 或 `screen -U -list` → 列出所有会话(你现在用的)
|
||||
- `screen -U -r` → 进入最后一个会话
|
||||
- `screen -U -r vllm_server` → 按名字进入(推荐,比数字更稳)
|
||||
- `screen -U -r 89505` → 只输入数字也可以(简写)
|
||||
- `screen -U -S vllm_server -X quit` → 杀死指定会话(你现在用的)
|
||||
- `screen -wipe` → 清理已死亡的会话记录(偶尔用)
|
||||
|
||||
# 在 screen 里面的快捷键(记住这几个就够用 90%)
|
||||
|
||||
| 快捷键 | 功能 |
|
||||
|--------|------|
|
||||
| `Ctrl-a ?` | 显示帮助(所有快捷键列表) |
|
||||
| `Ctrl-a c` | 新建一个窗口(像 tab) |
|
||||
| `Ctrl-a n` / `Ctrl-a p` | 切换到下一个/上一个窗口 |
|
||||
| `Ctrl-a 0~9` | 直接跳到第几个窗口 |
|
||||
| `Ctrl-a d` | 分离(退出) |
|
||||
| `Ctrl-a k` | 杀死当前窗口(确认 y) |
|
||||
| `Ctrl-a A` | 重命名当前窗口(好认) |
|
||||
| `Ctrl-a "` | 显示窗口列表,选择切换 |
|
||||
|
||||
# 高级实用技巧
|
||||
|
||||
- 滚动屏幕:`Ctrl-a [` → 进入复制模式,用上下键翻历史,按 `Esc` 退出
|
||||
- 发送命令给后台会话:`screen -S vllm_server -X stuff "echo hello\n"`
|
||||
- 自动启动 vLLM(推荐写进脚本):
|
||||
|
||||
```bash
|
||||
screen -U -dmS vllm_server
|
||||
screen -S vllm_server -X stuff "python -m vllm serve --model /root/autodl-tmp/DeepSeek-R1-1.5B --port 8000\n"
|
||||
```
|
||||
Reference in New Issue
Block a user