Skip to content
Back to blog
qwen codeArticle

Local Qwen Code: the medium profile from a home test

Wire-level reasoning effort, no fixed max_tokens, preserved thinking and task-scoped sessions removed observed failures in a home-PC experiment.

Author

Syntalith

Published Updated 3 min read

In the after-hours home-PC experiment, the selected Qwen Code profile used medium effort in both the client and request, preserved thinking, an advertised context capacity of 150,000 tokens and no fixed max_tokens limit. One RTX 3090 served one active agent because the server had one inference slot.

Each setting responds to a failure observed in this experiment. The guide records that working setup and its reasons.

The profile core

The fragment below shows the configuration structure. Replace the URL and environment-variable name; keep the key out of the JSON:

{
  "$version": 4,
  "model": {
    "name": "qwen3.8-27b",
    "reasoningEffort": "medium",
    "skipLoopDetection": true
  },
  "tools": { "approvalMode": "auto-edit" },
  "modelProviders": {
    "openai": [{
      "id": "qwen3.8-27b",
      "envKey": "QWEN_VLLM_API_KEY",
      "baseUrl": "http://127.0.0.1:18020/v1",
      "generationConfig": {
        "timeout": 0,
        "maxRetries": 1,
        "contextWindowSize": 150000,
        "extra_body": {
          "top_k": 20,
          "min_p": 0,
          "reasoning_effort": "medium",
          "chat_template_kwargs": { "preserve_thinking": true }
        }
      }
    }]
  }
}

Check the current schema in Qwen Code provider documentation. These measurements used Qwen Code 0.21.13. Run a fresh smoke test after upgrading the client.

Medium must reach the model

Client-side reasoningEffort was insufficient with the generic OpenAI provider. Qwen's embedded template selects xhigh when a request omits the level. The profile therefore also sends extra_body.reasoning_effort, which reaches the model layer directly.

On a small CSV export, one low run finished 3.47 seconds earlier than medium; the figure is the difference in elapsed time from launch to completion. That faster run missed the separator in the README. Older xhigh runs took longer without a repeatable quality gain. Medium became the default compromise for this setup, with ordinary model error still possible.

Why we removed fixed max_tokens

A fixed limit of 8,192 output tokens disabled Qwen Code's adaptive retry for writes of 8k–64k tokens. Long tool writes were truncated, and the agent attempted them again. The current settings omit the override so the client can use its recovery path.

The system still has boundaries. The server has a context limit, the queue has task limits, and a watchdog can stop identical no-progress sequences. The change avoids cutting a valid write at an arbitrary point.

A false loop detector

During the first frontend run, Qwen Code made distinct successful edits that its action-stagnation heuristic treated as a loop. The session ended before browser checks. We disabled the client heuristic for runs intended to finish without an artificial action limit.

External controls still stop genuine no-progress behaviour: repeated identical errors, the same command without state change or a growing queue. A client heuristic and process safety are different controls.

One card, one agent

The server had one inference slot, so it could generate one response at a time. Subagent fan-out serialized several conversations and multiplied context use. A team profile should disable parallel agents or send them to separate workers.

Permissions also depend on environment. auto-edit was appropriate in disposable test worktrees. A production repository needs branch protection, tests and recoverability. Deployment commands, secrets and cloud resources require separate gates.

Session hygiene

Resume when a follow-up depends on prior decisions. Start a fresh session for independent work after the previous task is complete. The repository already contains the edits, so replaying the full earlier conversation is unnecessary.

In our long frontend session, a two-rule CSS correction took 477.80 seconds from launch to completion. The result was correct, while the large history and medium reasoning made the step slow. That supports task-scoped sessions while preserving the quality setting for other work.

A copy-ready profile smoke

After a client or settings change, start Qwen Code in an empty worktree and use:

Create qwen-smoke.json with the exact content {"profile":"medium","ok":true}. Validate it with jq -e '.profile == "medium" and .ok == true' qwen-smoke.json. Change no other files.

The expected result is one new file, exit code 0 from jq and a final response describing only that change. Then ask in the same session to change profile to medium-resumed and validate again. This covers a tool write, command-result reading and a follow-up. It leaves coding quality untested, so we still run one repository task with a hidden check afterward.

Ship a profile with its test

A settings file without acceptance criteria turns into folklore. Include:

  • model hash and server image;
  • Qwen Code version;
  • a short JSON and tool smoke test;
  • one repository task with a hidden check;
  • expected elapsed-time range and VRAM-use range;
  • the previous working profile.

Syntalith includes this package in a local deployment and can teach the team to maintain it through the AI-Native course. For architecture and a quote, begin with the free process scan.

Free process scan

Start with a free process scan.

  • A 30-minute call with the engineer who would lead the work.
  • A review of the processes that cost you the most time and money.
  • A written summary of what to automate first and the likely cost range.

The scan chooses one process to assess, and within 2 business days you receive a recommendation, including when a simpler route is the better fit.

€0

30 minutes · written takeaway within 2 business days

Book a free process scan (30 min)

Times are shown in your own time zone. We work with clients across time zones.

Describe the process in the form