Skip to content

feat: Qwen VL grounding endpoint on Modal (OpenAI-compatible, scale-to-zero) - #124

Merged
abrichr merged 1 commit into
mainfrom
feat/qwen-grounder-endpoint
Aug 12, 2026
Merged

feat: Qwen VL grounding endpoint on Modal (OpenAI-compatible, scale-to-zero)#124
abrichr merged 1 commit into
mainfrom
feat/qwen-grounder-endpoint

Conversation

@abrichr

@abrichr abrichr commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

Stands up a self-hosted Qwen VL endpoint on Modal for openadapt-flow's OpenAICompatibleGrounder, as qwen_endpoint/:

  • Model: Qwen/Qwen2.5-VL-7B-Instruct pinned to HF revision cc594898137f460bfe9f0759e9844b3ce807cfb5, served bf16 by vLLM 0.10.1.1 on one A10G (24 GB), --max-model-len 16384. Upgrade path to Qwen3-VL-8B (needs vllm>=0.11) documented in the runbook, gated on a verified deploy.
  • Auth: every request needs the bearer token from the Modal secret qwen-endpoint-token (vLLM --api-key; unauthed => 401). The token is read only inside the serving container; the client launcher with_token.sh sources it from the macOS Keychain at runtime. No secret material anywhere in the repo.
  • Scale-to-zero: scaledown_window=120, no container floor, no warm pool. Weights cached in a Modal volume, so only the first-ever cold start pays the ~16 GB download.
  • Smoke harness: smoke_grounder.py drives flow's real OpenAICompatibleGrounder (not a re-implementation) against two committed flow fixtures (benchmark/dense_surface/record_seed1.png, replay_native_arial_seed1.png) and records hit/miss/abstain, latency, and per-request cost into RESULTS.md.
  • Operator wiring: deployment.snippet.yaml — the flow runtime: block pointing the grounder at this endpoint (api_key_env reference, PHI allowlist entry).
  • CI guard: tests/test_qwen_endpoint.py (stdlib-only, runs in docs CI) pins the invariants: secret name, <=120 s scaledown, no warm pool, exact model + vLLM pins, no long secret-like literals.

Not deployed yet — intentionally

Preflight found Modal auth present but no qwen-endpoint-token secret. Creating it is founder-only (one command, RUNBOOK.md section 0; registered as NEEDS_YOU B28). Once it exists, RUNBOOK sections 1-2 deploy and verify: 401 check, cold/warm latency, scale-to-zero check, and the 5-request grounder smoke — total GPU budget $5, expected ~$0.30. RESULTS.md holds the pre-registered protocol and blank tables.

The full grounding accuracy probe runs against Together in a sibling effort; this endpoint's smoke is wire-proof, not an accuracy claim.

Test plan

  • uv run --extra dev pytest tests/ -q — 149 passed (incl. 8 new)
  • uv run python scripts/validate_docs.py — clean
  • Post-secret: RUNBOOK sections 1-2 (deploy, 401, latency, scale-to-zero, smoke) — blocked on NEEDS_YOU B28

🤖 Generated with Claude Code

…o-zero)

Adds qwen_endpoint/: a Modal app serving Qwen/Qwen2.5-VL-7B-Instruct
(pinned HF revision cc59489) via vLLM 0.10.1.1 on one A10G behind an
OpenAI-compatible /v1/chat/completions route, for openadapt-flow's
OpenAICompatibleGrounder.

- Auth: bearer token from the Modal secret qwen-endpoint-token, enforced
  by vLLM --api-key (unauthed => 401). The token is read only inside the
  serving container; the client launcher (with_token.sh) sources it from
  the macOS Keychain at runtime. No secret material in the repo.
- Scale-to-zero: scaledown_window=120s, no container floor, no warm pool;
  weights cached in a Modal volume so later cold starts skip the download.
- smoke_grounder.py drives flow's real OpenAICompatibleGrounder against
  two committed flow fixtures (benchmark/dense_surface) and records
  hit/miss/abstain, latency, and per-request cost into RESULTS.md.
- deployment.snippet.yaml: operator-facing flow runtime config pointing
  the grounder at the endpoint (api_key_env reference, PHI allowlist).
- tests/test_qwen_endpoint.py pins the invariants (secret name, 120s
  scaledown, no warm pool, exact model/vLLM pins) in docs CI, stdlib-only.

Deploy is intentionally NOT performed in this PR: the qwen-endpoint-token
secret does not exist yet (founder-only creation; RUNBOOK.md section 0).
RESULTS.md records the blocked state and the exact verification protocol.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@abrichr
abrichr merged commit 938127a into main Aug 12, 2026
5 checks passed
@abrichr
abrichr deleted the feat/qwen-grounder-endpoint branch August 12, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant