Add Docker infrastructure for running TALES experiments - #38
Open
Marc-Alexandre Côté (MarcCote) wants to merge 8 commits into
Open
Add Docker infrastructure for running TALES experiments#38Marc-Alexandre Côté (MarcCote) wants to merge 8 commits into
Marc-Alexandre Côté (MarcCote) wants to merge 8 commits into
Conversation
Docker images (vLLM + SGLang): - docker/Dockerfile: All-in-one image based on vllm/vllm-openai:latest - docker/Dockerfile.sglang: Alternative image based on lmsysorg/sglang:latest - docker/entrypoint.sh: Unified entrypoint supporting both inference backends (SERVER_TYPE=vllm|sglang), activity-based startup timeout, parallel execution - docker/README.md: Comprehensive documentation with env var reference Local runner: - run_experiment.sh: Launch experiments via local Docker with full CLI (--model, --server, --gpu-count, --envs, --wandb, etc.) - .dockerignore: Whitelist-based to minimize build context Bug fixes: - agents/reasoning.py: Fix reasoning_effort parsed as string instead of int, add DeepSeek-V4 thinking tag extraction - benchmark.py: Handle incomplete WandB runs in continue-from logic - tales/token.py: Improve token counting robustness - tales/wandb_utils.py: Better handling of missing summary data Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Marc-Alexandre Côté (MarcCote)
force-pushed
the
macote/docker
branch
from
May 9, 2026 17:03
7b32d20 to
eed2765
Compare
Replace model-specific checks (Qwen3, DeepSeek) with generic detection: if <think> or </think> tags are found in the response, extract thinking content regardless of model name. This fixes MiniMax-M2.7 and any future model that uses <think> tags. DeepSeek remains a special case only for the 'disable thinking' mechanism (custom chat template). All other models use the standard chat_template_kwargs approach. Tested end-to-end with Qwen3-0.6B via vLLM: thinking content correctly extracted to Thinking field, actions clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DeepSeek-V4-Pro ships without a Jinja chat template (uses custom Python encoding). This caused vLLM to use a fallback template, resulting in no thinking being triggered (thinking_tokens=0 on WandB). Changes: - Add docker/templates/deepseek_v4.jinja2: V4-compatible template with enable_thinking kwarg (same mechanism as Qwen3) - Auto-detect V4 models in entrypoint.sh and pass --chat-template to both vLLM and SGLang servers - Add CHAT_TEMPLATE env var for explicit override - Move V4 from DeepSeek-R1-specific branch to generic branch in reasoning agent (uses chat_template_kwargs instead of custom chat template per-request) - Update .dockerignore to include docker/templates/ Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- agents/reasoning.py: enable_thinking=True for open models via vLLM/SGLang - agents/walkthrough.py: simplify reset logic, return QUIT when exhausted - docker/entrypoint.sh: remove deprecated --rope-scaling, restructure parallel execution (seeds sequential, games parallel within each seed) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mistral models (Magistral, etc.) use a native tokenizer that doesn't support chat_template_kwargs. Instead, thinking is enabled via vLLM's --enable-reasoning --reasoning-parser mistral flags, which puts thinking content in the 'reasoning' field of the API response. Changes: - Skip chat_template_kwargs for Mistral-native models - Use non-streaming for Mistral (streaming combine_chunks loses reasoning) - Extract reasoning from response.json() choices[0].message.reasoning - Accept responses with reasoning but empty content in retry loop - Wrap extracted reasoning in <think> tags for uniform downstream handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Magistral models use a Mistral native tokenizer that doesn't support Jinja2 chat_template_kwargs. They produce <think>...</think> tags in content when the system prompt includes thinking instructions. Changes: - Skip chat_template_kwargs for MISTRAL_NATIVE_MODELS - Add THINKING_INSTRUCTION suffix to system prompt for these models - No reasoning parser needed — existing think-tag parser handles them - Update entrypoint.sh to use --reasoning-config for vLLM 0.20.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Extract thinking from unclosed <think> blocks (token budget exceeded) - Keep truncated thinking stub in history so model continues reasoning Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Brings in all non-infrastructure improvements from the k8s branch: - agents/reasoning.py: Nemotron prompt-based thinking, Gemma4/Qwen3.5 thinking extraction fixes, generic <think> tag parsing, default cot-max-tokens, HF tokenizer fix for vLLM-served models - docker/entrypoint.sh: Auto-detect reasoning parser, auto-switch to reasoning agent when REASONING_EFFORT is set, sanity check before benchmark, export SERVER_URL/REASONING_PARSER - scripts/sanity_check.py: New thinking trace verification script - tales/token.py: Token counting improvements - agents/random.py: Minor cleanup - .dockerignore: Add scripts/ exclusion fix - MODEL_CANDIDATES.md: Model evaluation notes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8221a5ca-bf6d-4071-9edf-550c8897650f
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.
Docker images (vLLM + SGLang):
Local runner:
Bug fixes: