THUDM / THUDM/slime

[tau-bench] Make example runnable offline: stub user provider + robust tool parsing (parse_tools signature compatibility)

Open
#1,157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

What happened

I’m running examples/tau-bench/generate_with_tau.py to validate the episode logging pipeline on a local machine (no GPU / no triton).
The run previously aborted due to:

  • user simulation calling external LLM (litellm/gemini) → 429 / API key issues
  • tool parser API mismatch (parse_tools() signature differences across versions)
  • a small bug in response dict access (output.get[...] vs output.get(...))

Expected

  • Be able to run 1 task end-to-end without external API keys (at least for validating logging + control flow).
  • Robust tool parsing fallback if tool parser is unavailable or signature differs.

Proposed changes

  1. Offline user sim
  • Allow user_model_provider="stub" (or provider="stub") so env step doesn’t call external LLM
  • Returns a canned user message like "(stub user) OK."
  • Cost = 0
  1. Tool parsing compatibility
    Add a wrapper in openai_tool_adapter.py that:
  • detects parse_tools signature (2-arg vs 3-arg)
  • supports different return schemas (e.g. missing normal_text)
  • falls back to “no tool calls” when parser unavailable
  1. Bugfix
    Use:
raw_response = output.get("text", "")

(currently it is output.get["text"])

Repro

  • Start local sglang http endpoint (or stub server) on 127.0.0.1:30000
  • Environment: macOS, CPU-only, no triton installed
  • Sanity check:
curl -s -X POST http://127.0.0.1:30000/generate \
  -H "Content-Type: application/json" \
  -d '{"text":"Say ONLY: OK123","sampling_params":{"temperature":0,"max_new_tokens":8}}'
  • Run the tau-bench example with user_model_provider="stub"

Result after patch

  • episode.jsonl is generated and env_step proceeds with observation (stub user) OK.
  • No external API calls are needed (no Gemini/OpenAI keys), so no 429.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/tau-bench/generate_with_tau.py and the mentioned openai_tool_adapter.py, then run the provided local endpoint sanity check and one tau-bench task. Done means one task completes without external API keys, episode.jsonl is generated, env_step receives the stub user response, tool parsing tolerates the supported signatures or absence of a parser, and the response text access no longer errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.