การทดสอบ Alibaba Cloud Model Studio (Bailian 百炼)

Posted on 9 July 2024 by Alberto Roura.
alibaba cloudalicloudbailianaliyunaiqwenmodelthaillm

ในช่วงสองสามปีที่ผ่านมาผมได้เขียนเกี่ยวกับ AI และ LLMs หลายครั้งในบล็อกนี้ แต่ทุกครั้งที่พูดถึงจะเป็นการอ้างถึง OpenAI และโมเดล GPT3 ของพวกเขา

วันนี้ผมเขียนบทความที่ผมอยากจะเขียนมานานกว่า 3 ปี ทำไมเหรอ? เพราะว่า Alibaba Cloud เพิ่งเปิดตัวผลิตภัณฑ์ใหม่ Model Studio ซึ่งเป็นสนามเด็กเล่นสำหรับทดสอบและเล่นกับโมเดลต่าง ๆ เช่น Qwen, Tongyi Qwen, Tongyi Wanxiang และโมเดลแชทหลายตัวเช่น Qwen1.5-72B-Chat

ตามความรู้เรื่องนี้ ในเวอร์ชันภาษาจีนพวกเขาเรียกมันว่า Bailian (百炼) ซึ่งหมายถึง “การพัฒนาอย่างพิถีพิถันผ่านกระบวนการร้อยครั้ง” แสดงถึงการพัฒนาอย่างประณีตและคุณภาพสูง

เป็นส่วนหนึ่งของการประกาศเปิดตัว พวกเขาเปิดใช้งานแพลตฟอร์มทั้งหมดฟรีจนถึงวันที่ 15 กรกฎาคม ดังนั้นผมจึงเร่งทดสอบทุกอย่างที่สามารถทำได้ ในความเป็นจริง ผมจะแสดงตัวอย่างเล็ก ๆ น้อย ๆ ของวิธีการที่จะตั้งค่าและใช้งานพื้นฐานให้ดู

เอาล่ะ บอกข้อมูลเพิ่มเติมเกี่ยวกับ Model Studio หน่อย

บอกตรง ๆ Alibaba Cloud Model Studio โดดเด่นในฐานะแพลตฟอร์ม AI สร้างสรรค์ที่ครอบคลุมซึ่งสามารถใช้ได้สำหรับความต้องการทางธุรกิจหลายประการ

Alibaba Cloud Model Studio

มันสามารถมองว่าเป็นโซลูชันแบบครบวงจรในการผสานรวมโมเดลพื้นฐาน (FMs) โมเดลพื้นฐานเหล่านี้ถูกพัฒนาเพื่อรองรับความสามารถต่าง ๆ เช่น การแชท การสร้าง SQL (NL2SQL) และอื่น ๆ ทำให้นักพัฒนาสามารถสร้างแอปพลิเคชันที่ตอบสนองความต้องการเฉพาะได้อย่างรวดเร็ว

สิ่งที่ทำให้ผมประหลาดใจเกี่ยวกับ Alibaba Cloud Model Studio คือว่ามันเน้นไปที่นักพัฒนามากแค่ไหน มันทำให้การพัฒนาแอปพลิเคชัน AI ง่ายขึ้นมากด้วยเวิร์กโฟลว์ที่สร้างไว้ล่วงหน้า การจัดระเบียบภาพ และชุด API ที่สมบูรณ์

ผมเชื่อว่าการเน้นไปที่นักพัฒนาเพื่อทำให้ชีวิตของพวกเขาง่ายขึ้นเป็นกุญแจสำคัญ แต่ Model Studio ยังเสนอตัวเลือกในการปรับแต่งโมเดลด้วยข้อมูลที่กำหนดเองโดยใช้สถาปัตยกรรม Retrieval-Augmented Generation (RAG) ที่แยกออกจากเครือข่ายภายนอก หมายความว่าข้อมูลส่วนตัวของคุณจะยังคงเป็นส่วนตัว

ผลิตภัณฑ์นี้ถูกสร้างขึ้นเพื่อธุรกิจที่ต้องการใช้ AI โดยไม่ต้องจัดการกับโครงสร้างพื้นฐานที่ซับซ้อน

Features of Alibaba Cloud Model Studio

บทนำก็ดี แต่ลองสนุกกับสิ่งนี้หน่อยเถอะ

โอเค โอเค ผมเข้าใจ คุณอยากลองใช้งานเอง งั้นลองดูวิธีการทำงานของแพลตฟอร์ม “การพัฒนาอย่างพิถีพิถันผ่านกระบวนการร้อยครั้ง” นี้กันเถอะ

ขั้นตอนที่ 1: เล่นกับการแชท

ขั้นตอนนี้ง่ายมาก เพียงไปที่ Model Studio console และเริ่มแชทได้เลย

Chat with Qwen

ที่นี่ คุณสามารถเลือกโมเดลที่ต้องการแชทด้วย เช่น Qwen-Max, Qwen-Plus, Qwen-Turbo & Qwen1.5-32B-Chat ไปแชทกับเพื่อนใหม่ของคุณแล้วกลับมาอ่านวิธีการต่อไปนี้

ขั้นตอนที่ 2: รับ API Key

เรื่องนี้จริงจังแล้ว! เข้าไปที่หน้าจอ API Key Management และคลิกที่ “Create API Key” ในเพียงไม่กี่วินาทีคุณจะได้มัน มันจะมีลักษณะประมาณ sk-fexxxxxde91xxxxxe06cb34axxxxx8e

Testing Qwen-Max

ขั้นตอน 2.1: เปิดใช้งาน Model Service

ผมเรียกขั้นตอนนี้ว่า 2.1 เพราะคุณจะต้องเปิดใช้งานนี้เพียงครั้งแรกที่ใช้บริการ เข้าไปที่ Model Gallery และคลิก “Activate Model Service”

Activate Alibaba Cloud Model Studio Gallery

ขั้นตอนที่ 3: เลือกโมเดล

เยี่ยม! คุณมาถึงขั้นนี้แล้ว ดังนั้นมันก็คงสมเหตุสมผลที่คุณจะไปต่อ

ขั้นตอนนี้เกี่ยวกับการค้นหา เพราะว่า UI ของ Model Studio นั้นทำออกมาได้ดีมาก ยังอยู่ในลิงก์จากขั้นตอนข้างบน Model Gallery เราสามารถเลือกโมเดลที่เราต้องการทดสอบได้ ในกรณีของผม ผมเลือก “Qwen-Max” ซึ่งเป็นโมเดล Qwen 2.5 ที่รองรับพารามิเตอร์ระดับหลายร้อยพันล้าน ขณะนี้ Qwen-Max-0428 เป็นเวอร์ชันปัจจุบัน

Testing Qwen-Max

ตามตัวอย่างข้างบน เราจะได้คำสั่ง curl ดังต่อไปนี้:

curl --location "https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/text-generation/generation" \
--header "Authorization: Bearer <your-dashscope-api-key>" \
--header "Content-Type: application/json" \
--header "X-DashScope-SSE: enable" \
--data '{
    "model": "qwen-max",
    "input":{
        "messages":[
            {
                "role": "system",
                "content": "You are a helpful assistant."
            },
            {
                "role": "user",
                "content": "Introduce the capital of Thailand"
            }
        ]
    },
    "parameters": {
    }
}'

และคำขอเทียบเท่าที่ทำใน Node.js จะมีลักษณะดังนี้:

const axios = require('axios')

const config = {
  method: 'post',
  url: 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/text-generation/generation',
  headers: {
    'Authorization': 'Bearer <your-dashscope-api-key>',
    'Content-Type': 'application/json',
    'X-DashScope-SSE': 'enable',
  },
  data: {
    'model': 'qwen-max',
    'input': {
      'messages': [
        {
          'role': 'system',
          'content': 'You are a helpful assistant.',
        },
        {
          'role': 'user',
          'content': 'Introduce the capital of Thailand',
        },
      ],
    },
    'parameters': {},
  },
}

axios(config)
  .then((response) => {
    console.log(JSON.stringify(response.data))
  })
  .catch(console.error)

อย่าลืมแทนที่ <your-dashscope-api-key> ด้วย API key ที่แท้จริงของคุณ ผลลัพธ์ที่คุณอาจได้รับคือชุดของ JSON ที่เข้ารหัสจากการตอบกลับแบบเรียลไทม์ของโมเดล เนื่องจากเราขอให้ “Introduce the capital of Thailand” ต่อระบบพร้อมกับคำสั่งเริ่มต้นว่า “You are a helpful assistant” ผลลัพธ์สุดท้ายคือ:

{
  "output": {
    "finish_reason": "stop",
    "text": "Bangkok is the capital and most populous city of Thailand, officially known as Krung Thep Maha Nakhon in Thai. Located in the central part of the country, Bangkok is a bustling metropolis renowned for its vibrant street life, cultural landmarks, ornate temples, and modern architecture.\n\nWith a population of over 8 million people within the city proper and more than 14 million in the greater metropolitan area, Bangkok is not only the economic and political hub of Thailand but also a major center for transportation, commerce, and tourism in Southeast Asia.\n\nSome of the prominent attractions in Bangkok include the Grand Palace, which was once the residence of the Thai King and now serves as a stunning complex of buildings featuring exquisite examples of Thai architecture; Wat Phra Kaew (Temple of the Emerald Buddha), located within the Grand Palace grounds, housing the highly revered Emerald Buddha statue; Wat Arun (Temple of Dawn), a magnificent temple on the west bank of the Chao Phraya River with its iconic prang (tower) decorated with intricate ceramic tiles; and Wat Pho, famous for its giant reclining Buddha and being the birthplace of traditional Thai massage.\n\nIn addition to its historical and cultural sites, Bangkok offers a diverse range of experiences, from shopping at the iconic Chatuchak Weekend Market, one of the world's largest outdoor markets, to exploring the vibrant nightlife in areas like Khao San Road and enjoying the city's renowned street food scene, which has been recognized by UNESCO as a Creative City of Gastronomy.\n\nNavigating Bangkok often involves encounters with its extensive network of canals (khlongs) and the Chao Phraya River, earning it the nickname \"Venice of the East.\" The city's modern side is showcased through towering skyscrapers such as the Baiyoke Tower II and the bustling commercial districts of Silom and Sathorn.\n\nBangkok's blend of ancient traditions and modern development makes it a fascinating destination that continues to attract millions of visitors each year."
  },
  "usage": {
    "total_tokens": 433,
    "output_tokens": 408,
    "input_tokens": 25,
    "plugins": {}
  },
  "request_id": "6f807769-44d5-95d1-a814-fcb9d48586e4"
}

ไม่เลวเลย โมเดลรู้เรื่องเกี่ยวกับกรุงเทพฯ!

บทสรุป

การสำรวจ Alibaba Cloud Model Studio ถือเป็นก้าวที่น่าสนใจสำหรับผมในการทำความเข้าใจโลกของ AI และ LLMs มากขึ้น

นี่เป็นการทดสอบเล็ก ๆ แต่แพลตฟอร์มนี้มีชุดเครื่องมือและโมเดลที่ยอดเยี่ยม ทำให้เข้าถึงได้สำหรับนักพัฒนาทุกระดับและพื้นฐานในการสร้างแอปพลิเคชันที่ขับเคลื่อนด้วย AI

ที่นี่ โดยทำตามขั้นตอนที่ระบุในคู่มือนี้ รวมถึงการสร้างการตอบสนองโดยละเอียดเกี่ยวกับเมืองหลวงของประเทศไทยด้วยโมเดล Qwen-Max คุณสามารถเริ่มต้นได้อย่างรวดเร็วและเห็นศักยภาพของโมเดลเหล่านี้ด้วยตัวเอง

อนาคตของการพัฒนา AI ดูสดใสด้วยแพลตฟอร์มเช่น Alibaba Cloud Model Studio


Original article: การทดสอบ Alibaba Cloud Model Studio (Bailian 百炼).

✉️ Contact

Ready to take the next step? Don't wait any longer! If you're interested in learning more about Guztia products and services, or if you have any questions or concerns, book a meeting today.

Book a Meeting

Our team of experts is standing by, ready to assist you with anything you need. Book a Meeting, and Guztia will take care of the rest.