Nguyễn Tạ Bảo 21_0205
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Qwen 3 ASR Service — Documentation ## 1. Service Overview Qwen 3 ASR is a speech-to-text (Automatic Speech Recognition) service that converts audio recordings into text. It is built on Alibaba's **Qwen3-ASR-1.7B** model, served via vLLM for high-throughput GPU inference. | Field | Value | |-------|-------| | Model | Qwen/Qwen3-ASR-1.7B (1.7 billion parameters) | | Default language | Vietnamese (`vi`) | | Supported audio formats | WAV, MP3, M4A, FLAC, OGG, AAC (auto-converted to 16 kHz mono WAV) | | Production URL | `https://aifarm.mservice.com.vn/internal/halong-qwen-asr/` | | Swagger UI | `https://aifarm.mservice.com.vn/internal/halong-qwen-asr/docs` | | Cluster / Namespace / Sub Namespace | aifarm / halong / astro | | Authentication | None required | --- ## 2. How to Use the Service There are three supported ways to call the API. Each has different strengths depending on your use case. ### 2.1 curl (CLI) Best for: scripting, quick testing from terminal, CI/CD pipelines. **Chunked mode (recommended for speed):** ```bash curl -X POST \ "https://aifarm.mservice.com.vn/internal/halong-qwen-asr/v1/asr/transcribe/audio" \ -F "file=@/path/to/audio.mp3" \ -F "process_type=chunked" ``` **Full mode (recommended for short high-accuracy transcription):** ```bash curl -X POST \ "https://aifarm.mservice.com.vn/internal/halong-qwen-asr/v1/asr/transcribe/audio" \ -F "file=@/path/to/audio.wav" \ -F "process_type=full" ``` **With custom request ID for tracing:** ```bash curl -X POST \ "https://aifarm.mservice.com.vn/internal/halong-qwen-asr/v1/asr/transcribe/audio" \ -F "file=@/path/to/audio.wav" \ -F "process_type=chunked" \ -F "request_id=my-trace-id-123" ``` | Strengths | Weaknesses | |-----------|------------| | Simplest method, no extra tooling | Not visual, harder to inspect responses | | Easily scriptable and automatable | Manual file path management | | Available on any Linux/Mac terminal | | ### 2.2 n8n (Workflow Automation) Best for: automated workflows, chaining ASR with downstream processing (e.g., summarization, translation, notification). **HTTP Request node configuration:** | Setting | Value | |---------|-------| | Method | POST | | URL | `https://aifarm.mservice.com.vn/internal/halong-qwen-asr/v1/asr/transcribe/audio` | | Send Body | ON | | Body Content Type | **Multipart Form Data** | | Timeout | `300000` (5 minutes, under Options > Timeout) | **Body Parameters:** | Name | Parameter Type | Value | |------|---------------|-------| | `file` | n8n Binary Data | Binary data from a previous node (e.g., Read Binary File, HTTP Request, Google Drive) | | `process_type` | String | `chunked` or `full` | **Network requirement:** The n8n server must have firewall access to `aifarm.mservice.com.vn` on port 443. The domain resolves to the public IP `210.245.72.36`. If your n8n instance is on an internal network, ensure the whitelist rule targets this resolved IP, not just the internal IP. If you get `ETIMEDOUT` errors, this means the network path is blocked. Verify with your IT/network team that the n8n server's outgoing IP is whitelisted to reach `210.245.72.36:443`. | Strengths | Weaknesses | |-----------|------------| | Fully automatable workflows | Requires n8n instance | | Can chain with other nodes (Slack, email, database) | Network whitelist required from internal networks | | Supports scheduling and event triggers | | --- ## 3. API Specification ### 3.1 Transcribe Audio **Endpoint:** `POST /internal/halong-qwen-asr/v1/asr/transcribe/audio` **Content-Type:** `multipart/form-data` **Request fields:** | Field | Type | Required | Default | Description | |-------|------|----------|---------|-------------| | `file` | binary | Yes | — | Audio file (WAV, MP3, M4A, FLAC, OGG, AAC) | | `process_type` | string | No | `full` | `chunked` or `full` (see comparison below) | | `request_id` | string | No | auto UUID | Custom trace/correlation ID. Also accepted via `X-Request-ID` header. | **Success response (200):** ```json { "text": "transcribed text content here", "language": "vi", "request_id": "your-trace-id-or-auto-uuid" } ``` **Error response (4xx / 5xx):** ```json { "error": "Human-readable error description", "request_id": "trace-id" } ``` For 429 (rate limit) responses, an additional field is included: ```json { "error": "Too many requests. Server is at maximum capacity. Please retry.", "retry_after_seconds": 5, "request_id": "trace-id" } ``` ### 3.2 Processing Modes: Chunked vs Full | Aspect | `chunked` | `full` | |--------|-----------|--------| | **How it works** | Splits audio into 30-second chunks with 2-second overlap, processes all chunks in parallel, then merges results | Sends the entire audio as a single request to the model | | **Max audio duration** | 30 minutes | 10 minutes | | **Speed** | Faster for long audio (parallel processing) | Slower (single sequential call) | | **Accuracy** | May have minor artifacts at chunk boundaries | Higher accuracy (no boundary effects) | | **Concurrency limit** | 25 simultaneous requests | 5 simultaneous requests | | **Timeout** | 30 seconds per chunk | 300 seconds total | | **Best for** | Long recordings, batch processing, call center audio | Short recordings where accuracy matters most | | **Trade-off** | Speed over perfection | Perfection over speed | **When to use which:** - Audio under 30 seconds: either mode works equally well (no chunking occurs). - Audio 30 seconds to 10 minutes: use `full` if accuracy is critical, `chunked` if speed matters. - Audio 10 to 30 minutes: must use `chunked` (`full` rejects audio over 10 minutes). ### 3.3 Healthcheck **Endpoint:** `GET /internal/halong-qwen-asr/healthcheck` **Success (200):** ```json {"status": "ok"} ``` **Failure (500):** ```json {"detail": "service is not available"} ``` Use this endpoint to verify the service is running before sending transcription requests. --- ## 4. Grafana Monitoring **Grafana Dashboard URL:** https://aifarm.mservice.com.vn/grafana/d/halong-qwen-asr-prod-asr-metrics/halong-qwen-asr-prod-asr?orgId=1&from=now-1h&to=now&timezone=browser&var-ds=default&refresh=30s **Grafana VoctoriaLogs URL:** https://aifarm.mservice.com.vn/grafana/d/halong-qwen-asr-prod-asr-logs/halong-qwen-asr-prod-asr-logs?orgId=1&from=now-1h&to=now&timezone=browser&var-DS_VICTORIALOGS=PD775F2863313E6C7&var-query=&refresh=30s ### 4.1 Dashboard Panels The Grafana dashboard provides two views: **Metrics Dashboard (Prometheus):** | Panel | What it shows | |-------|---------------| | P99 Latency (ms) | 99th percentile end-to-end transcription latency over 5-minute windows | | Request Rate (req/min) | Total and error request rates | | Error Rate (%) | Percentage of failed requests | | Audio Duration Distribution | P50, P90, P99 of submitted audio duration | **Logs Dashboard (VictoriaLogs):** | Panel | What it shows | |-------|---------------| | Log Volume by Level | Count of INFO / WARNING / ERROR logs over time | | Errors by Error Code | Breakdown of errors by ASR error code | | Transcription Events | Completed and failed transcriptions with chunk details and timing | | Top Error Codes | Bar chart of most frequent error codes | | Per-Chunk vLLM Events | Individual chunk processing logs | | All Raw Logs | Unfiltered log search | ### 4.2 Prometheus Metrics All metrics are exposed on port 9090 and scraped by Victoria Metrics. | Metric Name | Type | Labels | Description | |-------------|------|--------|-------------| | `halong_qwen_asr_latency` | Histogram | `path` | End-to-end transcription latency (seconds) | | `halong_qwen_asr_http_requests_total` | Counter | `path`, `status` | Total requests. `status`: `all` or `error` | | `halong_qwen_asr_http_errors_total` | Counter | `path`, `status_code` | Failed requests by HTTP status code | | `halong_qwen_asr_audio_duration_seconds` | Histogram | `path` | Duration of submitted audio (seconds) | | `halong_qwen_asr_queue_depth` | Gauge | — | Requests currently waiting in concurrency queue | | `halong_qwen_asr_queue_wait_seconds` | Histogram | `path` | Time waiting in queue before processing starts | | `halong_qwen_asr_ffmpeg_convert_seconds` | Histogram | — | Audio format conversion latency | | `halong_qwen_asr_ffmpeg_convert_total` | Counter | `status` | Conversion attempts. `status`: `success` or `failed` | ### 4.3 Key Alerts to Watch - **Queue depth rising** (`halong_qwen_asr_queue_depth` > 10): service is approaching capacity. - **Error rate spike** (`halong_qwen_asr_http_errors_total`): check error codes in logs dashboard. - **P99 latency increase** (`halong_qwen_asr_latency`): may indicate GPU contention or longer-than-usual audio. --- ## 5. Error Codes Quick Reference All error codes are in the range ASR-6000 to ASR-6099. | Code | HTTP Status | Meaning | What to do | |------|-------------|---------|------------| | ASR-6000 | 500 | Healthcheck failed — vLLM backend is down | Wait and retry. If persistent, escalate to the Astro team. | | ASR-6001 | 500 | Unexpected vLLM proxy error | Retry. If persistent, check service logs. | | ASR-6002 | 503 | vLLM backend timed out | Audio may be too complex or service is overloaded. Retry later. | | ASR-6003 | 503 | vLLM backend unreachable | Service is restarting or the pod is down. Wait and retry. | | ASR-6004 | varies | vLLM returned an HTTP error | Check the response body for details. | | ASR-6010 | — | vLLM process failed to start | Internal startup error. Escalate to the Astro team. | | ASR-6030 | — | One or more chunks failed (partial result returned) | The response may be incomplete. Retry with `full` mode if accuracy matters. | | ASR-6040 | 400 | Blank / empty audio file | Provide a valid, non-empty audio file. | | ASR-6041 | 415 | Unsupported or corrupted audio format | Use a supported format: WAV, MP3, M4A, FLAC, OGG, AAC. | | ASR-6042 | 400 | Audio exceeds max duration | `chunked`: max 30 min. `full`: max 10 min. Trim or split the audio. | | ASR-6043 | 429 | Concurrency limit reached | Retry after the number of seconds indicated in `retry_after_seconds`. | | ASR-6044 | — | ffmpeg audio conversion failed | The audio file may be corrupted. Try a different format. | --- ## 6. Performance (Accuracy and Latency of System) [Qwen 3 ASR performance benchmark - 45 GB VRAM A100 ](https://docs.google.com/spreadsheets/d/19iyvdd_1KeeL77zRIMIbfohXS9Raqfnps_C_e5HhuG4/edit?usp=sharing) *For questions or issues, contact the Astro team (NLP-Research/bao.nguyen14) .*

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully