分类
devops

try qwen-code

奔着宣传的2000/day免费额度尝试一下?

支持两种验证: openai 和 qwen-oauth

  • qwen-oauth 是通过浏览器打开https://chat.qwen.ai网站授权,对于脚本化不够友好. 需要注册chat.qwen.ai

  • openai 可以通过ModelScope社区注册提供了2000/day的额度.需要注册而ModelScope

  • openai 可以直接走阿里云注册阿里云+阿里云实名制

阿里云也有新人免费额度 https://help.aliyun.com/zh/model-studio/new-free-quota

install qwen-code

npm install -g @qwen-code/qwen-code@latest --verbose
qwen --version
0.0.7

ref https://github.com/QwenLM/qwen-code

use qwen-code

qwen

登录方式选择

qwen-oauth

chat.qwen.ai

注册https://chat.qwen.ai/

openai

ModelScope (Free Tier)

ModelScope账户绑定阿里云账户–> https://modelscope.cn/docs/accounts/aliyun-binding-and-authorization

ModelScope支持模型列表

deepseek-ai/DeepSeek-R1-0528
deepseek-ai/DeepSeek-R1-Distill-Llama-70B
deepseek-ai/DeepSeek-R1-Distill-Llama-8B
deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
deepseek-ai/DeepSeek-V3
LLM-Research/c4ai-command-r-plus-08-2024
LLM-Research/Llama-4-Maverick-17B-128E-Instruct
LLM-Research/Llama-4-Scout-17B-16E-Instruct
Menlo/Jan-nano
MiniMax/MiniMax-M1-80k
mistralai/Ministral-8B-Instruct-2410
mistralai/Mistral-Large-Instruct-2407
mistralai/Mistral-Small-Instruct-2409
moonshotai/Kimi-K2-Instruct
opencompass/CompassJudger-1-32B-Instruct
PaddlePaddle/ERNIE-4.5-0.3B-PT
PaddlePaddle/ERNIE-4.5-21B-A3B-PT
PaddlePaddle/ERNIE-4.5-300B-A47B-PT
PaddlePaddle/ERNIE-4.5-VL-28B-A3B-PT
Qwen/QVQ-72B-Preview
Qwen/Qwen2.5-14B-Instruct
Qwen/Qwen2.5-14B-Instruct-1M
Qwen/Qwen2.5-32B-Instruct
Qwen/Qwen2.5-72B-Instruct
Qwen/Qwen2.5-7B-Instruct
Qwen/Qwen2.5-7B-Instruct-1M
Qwen/Qwen2.5-Coder-14B-Instruct
Qwen/Qwen2.5-Coder-32B-Instruct
Qwen/Qwen2.5-Coder-7B-Instruct
Qwen/Qwen2.5-VL-32B-Instruct
Qwen/Qwen2.5-VL-3B-Instruct
Qwen/Qwen2.5-VL-72B-Instruct
Qwen/Qwen2.5-VL-7B-Instruct
Qwen/Qwen2-VL-7B-Instruct
Qwen/Qwen3-0.6B
Qwen/Qwen3-14B
Qwen/Qwen3-1.7B
Qwen/Qwen3-235B-A22B
Qwen/Qwen3-235B-A22B-Instruct-2507
Qwen/Qwen3-235B-A22B-Thinking-2507
Qwen/Qwen3-30B-A3B
Qwen/Qwen3-30B-A3B-Thinking-2507
Qwen/Qwen3-32B
Qwen/Qwen3-4B
Qwen/Qwen3-8B
Qwen/Qwen3-Coder-30B-A3B-Instruct
Qwen/Qwen3-Coder-480B-A35B-Instruct
Qwen/QwQ-32B
Qwen/QwQ-32B-Preview
stepfun-ai/step3
XGenerationLab/XiYanSQL-QwenCoder-32B-2412
XGenerationLab/XiYanSQL-QwenCoder-32B-2504
ZhipuAI/GLM-4.5

aliyun百炼

兼容openapi接口的模型列表

curl -fsSL -H "Authorization: sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" https://dashscope.aliyuncs.com/compatible-mode/v1/models \
| jq -r '.data[].id' | sort



codeqwen1.5-7b-chat
deepseek-r1
deepseek-r1-distill-llama-70b
deepseek-r1-distill-llama-8b
deepseek-r1-distill-qwen-14b
deepseek-r1-distill-qwen-1.5b
deepseek-r1-distill-qwen-32b
deepseek-r1-distill-qwen-7b
deepseek-v3
qvq-max-2025-05-15
qvq-plus
qvq-plus-2025-05-15
qwen-14b-chat
qwen1.5-0.5b-chat
qwen1.5-110b-chat
qwen1.5-14b-chat
qwen1.5-1.8b-chat
qwen1.5-32b-chat
qwen1.5-72b-chat
qwen1.5-7b-chat
qwen-1.8b-chat
qwen-1.8b-longcontext-chat
qwen2-0.5b-instruct
qwen2-1.5b-instruct
qwen2.5-0.5b-instruct
qwen2.5-14b-instruct
qwen2.5-1.5b-instruct
qwen2.5-32b-instruct
qwen2.5-3b-instruct
qwen2.5-72b-instruct
qwen2-57b-a14b-instruct
qwen2.5-7b-instruct
qwen2.5-coder-0.5b-instruct
qwen2.5-coder-14b-instruct
qwen2.5-coder-32b-instruct
qwen2.5-coder-3b-instruct
qwen2.5-coder-7b-instruct
qwen2.5-math-1.5b-instruct
qwen2.5-math-72b-instruct
qwen2.5-math-7b-instruct
qwen2-72b-instruct
qwen2-7b-instruct
qwen3-0.6b
qwen3-14b
qwen3-1.7b
qwen3-235b-a22b
qwen3-30b-a3b
qwen3-32b
qwen3-4b
qwen3-8b
qwen3-coder-480b-a35b-instruct
qwen3-coder-plus
qwen3-coder-plus-2025-07-22
qwen-72b-chat
qwen-7b-chat
qwen-coder-plus
qwen-coder-plus-1106
qwen-coder-plus-latest
qwen-coder-turbo
qwen-coder-turbo-0919
qwen-coder-turbo-latest
qwen-long
qwen-math-plus
qwen-math-plus-0919
qwen-math-plus-latest
qwen-math-turbo
qwen-math-turbo-0919
qwen-math-turbo-latest
qwen-max
qwen-max-0107
qwen-max-0403
qwen-max-0428
qwen-max-0919
qwen-max-1201
qwen-max-latest
qwen-max-longcontext
qwen-mt-plus
qwen-mt-turbo
qwen-plus
qwen-plus-0919
qwen-plus-2025-07-14
qwen-plus-latest
qwen-tts-2025-05-22
qwen-turbo
qwen-turbo-0919
qwen-turbo-latest
qwen-vl-max
qwen-vl-max-2025-04-02
qwen-vl-ocr
qwen-vl-ocr-latest
qwen-vl-plus
qwen-vl-plus-2025-08-15

qwen –help

cat ~/.qwen/settings.json
{
  "selectedAuthType": "qwen-oauth"
}


cat ~/.qwen/oauth_creds.json
{
  "access_token": "xxxXXXXXXXXXXXXXXXXX",
  "token_type": "Bearer",
  "refresh_token": "xxxxxxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "resource_url": "portal.qwen.ai",
  "expiry_date": 1755764268546
}

ls ~/.qwen/
installation_id  oauth_creds.json  settings.json  tmp
qwen --help
qwen [options]

Qwen Code - Launch an interactive CLI, use -p/--prompt for non-interactive mode

Options:
  -m, --model                                 Model                              [string]
  -p, --prompt                                Prompt. Appended to input on stdin (if
                                              any).                              [string]
  -i, --prompt-interactive                    Execute the provided prompt and continue in
                                              interactive mode                   [string]
  -s, --sandbox                               Run in sandbox?                   [boolean]
      --sandbox-image                         Sandbox image URI.                 [string]
  -d, --debug                                 Run in debug mode?
                                                               [boolean] [default: false]
  -a, --all-files                             Include ALL files in context?
                                                               [boolean] [default: false]
      --all_files                             Include ALL files in context?
      [deprecated: Use --all-files instead. We will be removing --all_files in the coming
                                                       weeks.] [boolean] [default: false]
      --show-memory-usage                     Show memory usage in status bar
                                                               [boolean] [default: false]
      --show_memory_usage                     Show memory usage in status bar
    [deprecated: Use --show-memory-usage instead. We will be removing --show_memory_usage
                                         in the coming weeks.] [boolean] [default: false]
  -y, --yolo                                  Automatically accept all actions (aka YOLO
                                              mode, see
                                              https://www.youtube.com/watch?v=xvFZjo5PgG0
                                              for more details)?
                                                               [boolean] [default: false]
      --telemetry                             Enable telemetry? This flag specifically
                                              controls if telemetry is sent. Other
                                              --telemetry-* flags set specific values but
                                              do not enable telemetry on their own.
                                                                                [boolean]
      --telemetry-target                      Set the telemetry target (local or gcp).
                                              Overrides settings files.
                                                       [string] [choices: "local", "gcp"]
      --telemetry-otlp-endpoint               Set the OTLP endpoint for telemetry.
                                              Overrides environment variables and
                                              settings files.                    [string]
      --telemetry-log-prompts                 Enable or disable logging of user prompts
                                              for telemetry. Overrides settings files.
                                                                                [boolean]
      --telemetry-outfile                     Redirect all telemetry output to the
                                              specified file.                    [string]
  -c, --checkpointing                         Enables checkpointing of file edits
                                                               [boolean] [default: false]
      --experimental-acp                      Starts the agent in ACP mode      [boolean]
      --allowed-mcp-server-names              Allowed MCP server names            [array]
  -e, --extensions                            A list of extensions to use. If not
                                              provided, all extensions are used.  [array]
  -l, --list-extensions                       List all available extensions and exit.
                                                                                [boolean]
      --ide-mode-feature                      Run in IDE mode?                  [boolean]
      --openai-logging                        Enable logging of OpenAI API calls for
                                              debugging and analysis            [boolean]
      --openai-api-key                        OpenAI API key to use for authentication
                                                                                 [string]
      --openai-base-url                       OpenAI base URL (for custom endpoints)
                                                                                 [string]
      --tavily-api-key                        Tavily API key for web search functionality
                                                                                 [string]
      --proxy                                 Proxy for gemini client, like
                                              schema://user:password@host:port   [string]
      --include-directories                   Additional directories to include in the
                                              workspace (comma-separated or multiple
                                              --include-directories)              [array]
      --load-memory-from-include-directories  If true, when refreshing memory, QWEN.md
                                              files should be loaded from all directories
                                              that are added. If false, QWEN.md files
                                              should only be loaded from the primary
                                              working directory.
                                                               [boolean] [default: false]
  -v, --version                               Show version number               [boolean]
  -h, --help                                  Show help                         [boolean]

try simple

echo "99的平方是多少?" | qwen -p --yolo
Loaded cached Qwen credentials.
99 的平方是 9801。

ref