Unlock the Power of Conversational AI: Create Your Own Chatbot Using Qwen, Model Studio, and FC
Written by M Fakhri Darmawan, Solution Architect Alibaba Cloud Indonesia
In today’s fast-paced digital world, chatbots have become indispensable tools for businesses and developers looking to enhance user experiences, automate workflows, and scale customer interactions. But what if you could build a highly intelligent, customizable chatbot tailored to your exact needs? Enter Qwen, Alibaba Cloud’s state-of-the-art large language model, combined with the robust capabilities of Model Studio and Function Compute (FC). In this blog, we’ll guide you step-by-step through the process of creating your very own chatbot using these cutting-edge technologies—empowering you to harness the full potential of conversational AI without breaking a sweat.
Step 1
Activate Model Studio with no cost using this LINK. Next is create API Key.
Step 2
Create and Get API Key
1. Hover your cursor over
in the upper-right corner of the page and select API-KEY.

2. In the left-side navigation pane, select All API Keys or My API Key to view or create API keys. Click Create My API Key or View existing APi keys.

Note
- You can only use the All API Keys page if you are using the Alibaba Cloud account. The Alibaba Cloud account can obtain the API keys of all RAM users, but a RAM user can only obtain its own API key.
- Keep your API key confidential to avoid security risks or financial losses caused by unauthorized usage.
- You API key is an important asset, make sure to keep it safe. If you click Delete in the Actions column to delete an existing API Key, you cannot use the key to use Model Studio services again. All applications or services associated with this key will fail.
Step 3
Create and Deploy Model Studio Application
Agent application - Alibaba Cloud Model Studio - Alibaba Cloud Documentation Center
Step 4
Get Application ID
Step 5
Deploy Chatbot Sample Application
Prerequisite
- Install nodejs version 22 (How to Install Node.js v22 on Linux: A Step-by-Step Guide)
- Install npm
- Install and configure serverless dev (Quick start - Function Compute - Alibaba Cloud Documentation Center)
Steps
1. Download code from this github repository.
2. Unzip the code
3. Change code in s.yaml file
edition: 3.0.0
name: fc3-example
access: default
resources:
fcDemo:
component: fc3
props:
region: ap-southeast-1
handler: handler
role: ''
disableOndemand: false
description: web-chatbot
timeout: 180
internetAccess: true
layers:
- acs:fc:ap-southeast-1:official:layers/Nodejs16/versions/2
customRuntimeConfig:
args:
- run
- start
port: 9000
command:
- npm
# logConfig: # define log project in sls to enable log for your FC
# enableRequestMetrics: true
# enableInstanceMetrics: true
# logBeginRule: DefaultRegex
# project: serverless-ap-southeast-5-xxx
# logstore: default-logs
functionName: webchat-bot
runtime: custom
instanceConcurrency: 1
memorySize: 128
environmentVariables:
PATH: >-
/opt/nodejs16/bin:/usr/local/bin/apache-maven/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ruby/bin:/opt/bin:/code:/code/bin
BAILIAN_APP_ID: 386XXX # put your model studio application id here
BAILIAN_API_KEY: sk-xxx #put your API Key here or in FC Configuration -> Environment variable
LD_LIBRARY_PATH: >-
/code:/code/lib:/usr/local/lib:/opt/lib:/opt/php8.1/lib:/opt/php8.0/lib:/opt/php7.2/lib
STATIC_DIR: /public
NODE_PATH: /opt/nodejs/node_modules
SECRET: ''
code: ./webchat-bot-fd
triggers:
- triggerConfig:
methods:
- GET
- POST
- PUT
- DELETE
- HEAD
- PATCH
authType: anonymous
disableURLInternet: false
triggerName: httpTrigger
description: ''
qualifier: LATEST
triggerType: http
Code need to change :
a) Line 37. “ BAILIAN_APP_ID: 386XXX # put your model studio application id here “
b) Line 38. “ BAILIAN_API_KEY: sk-xxx #put your API Key here or in FC Configuration -> Environment variable ”
4. Deploy the code using serverless deployment
s deploy s.yaml
Result if the deployment succeeds
[2025-03-14 17:08:53][WARN][s_cli] It is not recommended to run the command as root user.
(node:56555) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
⌛ Steps for [deploy] of [fc3-example]
====================
disableOndemand: false
* You can also specify to use local configuration through --assume-yes/-y during deployment
? Deploy it with local config? Yes
(node:56555) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
TIPS:
You can use "s info" get more detail
✔ [fcDemo] completed (14.88s)
🚀 Result for [deploy] of [fc3-example]
====================
region: ap-southeast-1
customRuntimeConfig:
args:
- run
- start
command:
- npm
port: 9000
description: web-chatbot
environmentVariables:
BAILIAN_API_KEY: sk-xxx
BAILIAN_APP_ID: 386b4ab2a301472688b3e35906a15fe1
LD_LIBRARY_PATH: /code:/code/lib:/usr/local/lib:/opt/lib:/opt/php8.1/lib:/opt/php8.0/lib:/opt/php7.2/lib
NODE_PATH: /opt/nodejs/node_modules
PATH: /opt/nodejs16/bin:/usr/local/bin/apache-maven/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ruby/bin:/opt/bin:/code:/code/bin
SECRET:
STATIC_DIR: /public
functionArn: acs:fc:ap-southeast-1:5846842125303498:functions/webchat-bot
functionName: webchat-bot
handler: handler
instanceConcurrency: 1
internetAccess: true
layers:
- acs:fc:ap-southeast-1:official:layers/Nodejs16/versions/2
memorySize: 128
role:
runtime: custom
timeout: 180
triggers:
-
description:
qualifier: LATEST
triggerConfig:
methods:
- GET
- POST
- PUT
- DELETE
- HEAD
- PATCH
authType: anonymous
disableURLInternet: false
triggerName: httpTrigger
triggerType: http
url:
system_url: https://webchat-bot-usebaqmcxe.ap-southeast-1.fcapp.run
system_intranet_url: https://webchat-bot-usebaqmcxe.ap-southeast-1-vpc.fcapp.run
__component: fc3
5. Ensure the FC was deployed and environment variable was configured correctly


6. Add your domain

Put your domain, select your function and version, then create the application

Configure your domain and pointing to CNAME from Function Compute
7. Go to your domain and test the application and try using your own promt

Benefits:
• Easy Deployment: No need to manage servers; Function Compute handles scaling and infrastructure.
• Customizable: Model Studio allows you to tailor Qwen to your specific business requirements.
• Cost-Effective: Pay only for the compute resources used during conversations.
Use Cases:
• Customer support automation.
• Virtual assistants for websites or apps.
• Interactive FAQ bots.
This setup combines Qwen's powerful conversational AI, Model Studio's customization capabilities, and Function Compute's scalability to create a flexible and efficient chatbot solution.
Read previous post:
Demystifying Alibaba Cloud Landing Zone: Your Blueprint for Secure and Efficient Cloud Adoption
Read next post:
Bridging the Gap in Generative AI: Fine-Tuning Meets RAG on Alibaba Cloud
-
-
Alibaba Cloud Indonesia
128 posts | 23 followers
Follow
Comments
-
-
Alibaba Cloud Indonesia
128 posts | 23 followers
Follow
Related Products
-
QwenWork
QwenWork is dedicated to helping employees strengthen their professional competitiveness in the AI era and to enabling enterprises to improve organizational effectiveness.
Learn More -
Token Plan
Build more, spend less. One plan, every modality.
Learn More -
Alibaba Cloud Model Studio
A one-stop generative AI platform to build intelligent applications that understand your business, based on Qwen model series such as Qwen-Max and other popular models
Learn More -
Function Compute
Alibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.
Learn More
More Posts by Alibaba Cloud Indonesia
- Stop Rebuilding Your App for AI. Add an Agent Instead.
- Giving Your AI Agent a Disposable Workspace with Alibaba Cloud AgentRun
- Resolving Alibaba Cloud DTS Pre-checks: Mapping the ali_decoding Extension for Older Version PostgreSQL (below 10) on Ubuntu
- Boost Your Coding Workflow with Qwen Code: A Practical Guide
- Building an Enterprise-Grade Cloud Backbone: Connecting VPCs with Alibaba Cloud CEN
- Entering the AI-Native Era: How DAS Leverages LLMs to Revolutionize Database Autonomy
- Getting Started with Qoder - A Step-by-Step Guide for Teams
- Will AI Replace You? The Risks, Opportunities, and How to Prepare Across Seven Key Industries
- Building Skills for Qoder: A Developer's Guide
- Self-Hosted GPU or Model-as-a-Service? A Strategic Guide for AI Leaders