Skip to main content
View source

Qwen

View as Markdown

A RocketRide LLM node that connects Alibaba Cloud Qwen models to a pipeline via the DashScope API.

What it does

Provides Qwen chat completions to the pipeline. Used primarily as an llm invoke connection by agents and other nodes that need an LLM, and can also be used directly via lanes.

Uses LangChain's ChatOpenAI client pointed at DashScope's OpenAI-compatible endpoint. The regional endpoint is resolved from the region field at startup. Temperature is fixed at 0, and max_tokens is taken from the profile's modelOutputTokens.

When the node configuration is validated, the node performs a live 1-token test request against the API to verify the key, model, and region actually work. Failures surface as configuration warnings with the provider's error message.


Configuration

Lanes

Lane inLane outDescription
questionsanswersSend a question directly, receive a generated answer

Fields

The main setting is the profile (model selection, default qwen-flash). Each profile exposes the API key, region, and model-source fields. The custom profile additionally exposes the model name and context length.

FieldType / DefaultDescription
profileenum, qwen-flashQwen AI model selection (see profiles below, or custom)
apikeystringDashScope API key. Must start with sk-.
regionenum, usDashScope regional endpoint: us, intl, or cn (see regions below)
modelstringQwen model name (custom profile only)
modelTotalTokensnumberMaximum context length in tokens (custom profile only, must be > 0)

Profiles

ProfileModelContext tokensOutput tokens
Qwen Flash (default)qwen-flash131,0724,096
Qwen Plusqwen-plus1,000,00032,768
Qwen2.5 72B Instructqwen-2.5-72b-instruct32,76816,384
Qwen2.5 7B Instructqwen-2.5-7b-instruct32,76832,768
Qwen2.5 Coder 32B Instructqwen-2.5-coder-32b-instruct32,7684,096
Qwen-Maxqwen-max32,7688,192
Qwen Plus 0728qwen-plus-2025-07-281,000,00032,768
Qwen Plus 0728 (thinking)qwen-plus-2025-07-28:thinking1,000,00032,768
Qwen-Turboqwen-turbo131,0728,192

Choose custom to set the model name and context length manually.


Regions

region selects the DashScope regional endpoint used for all API calls:

ValueRegionEndpoint
usUS (Virginia)https://dashscope-us.aliyuncs.com/compatible-mode/v1
intlSingaporehttps://dashscope-intl.aliyuncs.com/compatible-mode/v1
cnChina (Beijing)https://dashscope.aliyuncs.com/compatible-mode/v1

The default is us. An unrecognised value falls back to the US endpoint.

Note: DashScope API keys are not interchangeable between regions. A key issued for one region will fail authentication against another region's endpoint.


Authentication

Provide a DashScope API key in apikey. The key must start with sk-; anything else is rejected before any request is made. Make sure the key was issued for the region you select.


Error handling

Provider exceptions are mapped to friendly messages instead of raw stack traces:

  • Authentication failures surface as "Invalid DashScope API key."
  • Rate-limit errors surface as "Rate limit exceeded. Please try again later."
  • Connection failures surface as "Failed to connect to the DashScope API."
  • Other DashScope API errors surface as "An error occurred with the DashScope API."

Rate-limit and connection errors are classified as retryable by the shared chat base; authentication and generic API errors are not retried.


Upstream docs


Schema

FieldTypeDescriptionDefault
modelstringModel
Qwen model
modelTotalTokensnumberTokens
Maximum context length in tokens
qwen.profilestringModel
Qwen AI model selection
"qwen-flash"
qwen.regionstringRegion
DashScope regional endpoint. API keys are not interchangeable between regions.
"us"

Dependencies

  • openai
  • langchain-openai
  • langchain-core
  • langchain