VLLM_URL := "http://localhost:8000"
MODEL := "cpatonn/Qwen3-Omni-30B-A3B-Instruct-AWQ-4bit"
AUDIO_PATH := "data/audio.wav"

run:
    docker run \
        --gpus=all \
        --ipc=host \
        --volume="$HOME/.cache/huggingface:/root/.cache/huggingface" \
        --publish=0.0.0.0:8000:8000 \
        --entrypoint=/bin/bash \
        docker.io/vllm/vllm-openai:v0.13.0 \
            -c "pip install vllm[audio] && python3 -m vllm.entrypoints.openai.api_server \
                --tensor-parallel-size=2 \
                --gpu-memory-utilization=0.9 \
                --model={{ MODEL }} \
                --max-num-seqs=10 \
                --limit-mm-per-prompt='{\"audio\":1}' \
                --max-model-len=8192"

query:
    #!/usr/bin/env bash
    cat <<EOF | curl "{{ VLLM_URL }}/v1/chat/completions" \
        --header "Content-Type: application/json" \
        --data @-
    {
        "model": "{{ MODEL }}",
        "messages": [
            {
                "role": "user",
                "content": [
                    { "type": "text", "text": "What is in this audio?" },
                    {
                        "type": "input_audio",
                        "input_audio": {
                            "data": "$(base64 < "{{ AUDIO_PATH }}" | tr -d '\n')",
                            "format": "wav"
                        }
                    }
                ]
            }
        ]
    }
    EOF
