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.
Activate Model Studio with no cost using this LINK. Next is create 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
Agent application - Alibaba Cloud Model Studio - Alibaba Cloud Documentation Center
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.
Demystifying Alibaba Cloud Landing Zone: Your Blueprint for Secure and Efficient Cloud Adoption
Bridging the Gap in Generative AI: Fine-Tuning Meets RAG on Alibaba Cloud
110 posts | 20 followers
FollowAlibaba Cloud Community - September 6, 2024
Farruh - February 19, 2024
Ashish-MVP - April 8, 2025
Alibaba Cloud Community - September 20, 2024
Alibaba Cloud Native Community - February 20, 2025
Farruh - March 22, 2024
110 posts | 20 followers
FollowAlibaba 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 MoreAccelerate AI-driven business and AI model training and inference with Alibaba Cloud GPU technology
Learn MoreTop-performance foundation models from Alibaba Cloud
Learn MoreOffline SDKs for visual production, such as image segmentation, video segmentation, and character recognition, based on deep learning technologies developed by Alibaba Cloud.
Learn MoreMore Posts by Alibaba Cloud Indonesia