CoolFace
Apppublic

tuandunghcmut/qwen-agentworld-agent

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes
App README

๐Ÿค– Qwen-AgentWorld Tool-Calling Agent

A chatbot agent powered by `Qwen/Qwen-AgentWorld-35B-A3B` running on Hugging Face ZeroGPU.

The model acts as the agent policy: it decides which tool to call and with what arguments. The Space then executes the real tool and feeds the result back, looping until the model produces a final answer.

Tools available to the agent

ToolWhat it does
web_searchDuckDuckGo web search (via ddgs)
run_bashRuns a shell command inside the Space container
run_pythonExecutes a short Python snippet and returns its stdout
write_todoCreates / overwrites the task to-do list
update_todoMarks a to-do item done / not done

How it works

  1. 1.The user message is added to the conversation with the tool schemas (tokenizer.apply_chat_template(..., tools=TOOL_SPECS)).
  2. 2.The model generates; <tool_call>{...}</tool_call> blocks are parsed out.
  3. 3.Each tool runs, results are appended as role: tool messages.
  4. 4.Loop until the model answers in plain prose (max MAX_TOOL_STEPS).

Configuration (Space variables / secrets)

VariableDefaultPurpose
MODEL_IDQwen/Qwen-AgentWorld-35B-A3BModel to load
MAX_NEW_TOKENS1536Generation length per step
MAX_TOOL_STEPS6Max tool-call iterations per turn
GPU_DURATION120ZeroGPU seconds reserved per call

Notes & caveats

  • โ€”ZeroGPU requires a PRO account (or a Team/Enterprise org). This Space is hosted under a PRO account.
  • โ€”The model is loaded in 4-bit (nf4) so the 35B MoE fits the ZeroGPU budget and loads quickly. Set the env var path / drop the quant config in app.py to run full precision on dedicated hardware.
  • โ€”Qwen-AgentWorld is officially a world model (it can simulate environments). Here it is driven as a real tool-using agent; tool-call reliability may vary. Adjust the system prompt in app.py to taste.
  • โ€”run_bash / run_python execute inside the Space sandbox. Keep the Space private if you don't want arbitrary code execution exposed publicly.