feat: initialize XAS test console with native execution
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# 原样脚本副本
|
||||
|
||||
复制日期:2026-10-13(北京时间)。用户明确授权复制一份脚本。
|
||||
|
||||
- 来源:/dengyuyun-joy-work-space/workpc-claude-code/20261010-dsv41-trial/scripts/smoke.sh
|
||||
- 原作者标注:dengyuyun-joy,保留原注释。
|
||||
- SHA-256:be858e914d87454240791da773578cb3f80f380e740f919546db347b7715a13d
|
||||
- 修改:无,按字节复制;固定端口、模型名、提示词和输出限制全部保留。
|
||||
- 依赖:Bash、curl、Python 标准库。
|
||||
- 外部调用:一次 GET /v1/models,三个顺序 POST /v1/chat/completions。
|
||||
- 脚本只输出标准输出;控制台包装层保存日志和结构化汇总,不向原工作区写入文件。
|
||||
- 原脚本不含认证参数;隔离执行环境的限定代理按需使用现有服务凭据,凭据不在此仓库。
|
||||
|
||||
此副本不自动跟随原文件变化。后续更新需重新审阅差异、记录新哈希并验证。
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# dengyuyun-joy: quick functional check against the trial API.
|
||||
U=http://127.0.0.1:18100
|
||||
curl -s -m 10 $U/v1/models | python3 -c "import json,sys;d=json.load(sys.stdin);print('models:',[(m['id'],m.get('max_model_len')) for m in d['data']])"
|
||||
for q in "用一句话介绍你自己。" "计算 123456 × 789,只给出结果。" "Write a Python function that returns the n-th Fibonacci number, then explain it in one sentence."; do
|
||||
python3 - "$q" <<'PY'
|
||||
import json,sys,time,urllib.request
|
||||
q=sys.argv[1]
|
||||
body={"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":q}],"temperature":0,"max_tokens":512}
|
||||
t=time.time()
|
||||
r=urllib.request.urlopen(urllib.request.Request("http://127.0.0.1:18100/v1/chat/completions",json.dumps(body).encode(),{"Content-Type":"application/json"}),timeout=600)
|
||||
d=json.load(r); dt=time.time()-t
|
||||
m=d["choices"][0]["message"]; u=d.get("usage",{})
|
||||
print("Q:",q); print("A:",(m.get("content") or "").strip()[:600]); print("reasoning chars:",len(m.get("reasoning_content") or m.get("reasoning") or ""))
|
||||
print(f"usage={u} wall={dt:.1f}s ~{u.get('completion_tokens',0)/dt:.1f} tok/s"); print("-"*60)
|
||||
PY
|
||||
done
|
||||
Reference in New Issue
Block a user