feat: Qwen VL grounding endpoint on Modal (OpenAI-compatible, scale-to-zero) - #124
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stands up a self-hosted Qwen VL endpoint on Modal for openadapt-flow's
OpenAICompatibleGrounder, asqwen_endpoint/:Qwen/Qwen2.5-VL-7B-Instructpinned to HF revisioncc594898137f460bfe9f0759e9844b3ce807cfb5, 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.qwen-endpoint-token(vLLM--api-key; unauthed => 401). The token is read only inside the serving container; the client launcherwith_token.shsources it from the macOS Keychain at runtime. No secret material anywhere in the repo.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_grounder.pydrives flow's realOpenAICompatibleGrounder(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 intoRESULTS.md.deployment.snippet.yaml— the flowruntime:block pointing the grounder at this endpoint (api_key_envreference, PHI allowlist entry).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-tokensecret. 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.mdholds 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🤖 Generated with Claude Code