Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
English
简体中文English
Prompts and workflows

Qwen3.7 Max · configuration

Qwen3.7-Max: OpenCode Cache Configuration and Agent Guardrails

An OpenCode community case combines OpenRouter caching, context budgets, and stop conditions to contain Qwen3.7 Max agents; results depend on the client and provider.

Source not verifiedQwen3.7 Max client or API; pin the live model ID, provider, tools, permissions, and snapshot before execution.

Prerequisites and inputs

  • task goal
  • source or reference material
  • runtime constraints
  • acceptance criteria

One-sentence takeaway

When integrating Qwen3.7-Max via OpenRouter in OpenCode CLI or similar agent frameworks, you must explicitly pass context-caching request headers through the @ai-sdk/alibaba adapter layer and avoid unbound indirect tool rules in AGENTS.md to prevent single-session token runaways exceeding 8M+ tokens.

Use cases

  • Suitable tasks: Running Qwen3.7-Max for code engineering and complex refactoring via OpenCode CLI, Claude Code, or custom agent architectures.

  • Unsuitable tasks: Allowing the model to autonomously invoke high-frequency CLI tools without cache configuration or in an unobservable environment.

  • Applicable model versions: qwen/qwen-3.7-max (OpenRouter alias ) or Alibaba Cloud official qwen3.7-max.

  • Applicable clients, agents, or APIs: OpenCode CLI, Claude Code compatibility layer, OpenRouter API, and DashScope API.

  • Recommended reasoning levels and parameters: Place a fixed prefix at the top of the system prompt to enable Prompt Caching, and disable open-ended, non-strict matching instructions.

Ready-to-use content

1. opencode.json configuration to enable OpenRouter context caching in OpenCode CLI

{
  "provider": {
    "openrouter-cached": {
      "npm": "@ai-sdk/alibaba",
      "name": "OpenRouter (Cached)",
      "options": {
        "baseURL": "https://openrouter.ai/api/v1",
        "apiKey": "YOUR_OPENROUTER_API_KEY"
      },
      "models": {
        "qwen/qwen-3.7-max": {
          "name": "Qwen 3.7 Max"
        }
      }
    }
  }
}

2. Agent specification template ( AGENTS.md ) to prevent repetitive context rewrites and token runaways with Qwen3.7-Max

# Agent Execution Guardrails for Qwen3.7-Max

## Core Execution Rules
1. Tool Invocation Mapping:
   - When reading repository context, use ONLY the exact registered tool name `grep_search` or `view_file`.
   - Do NOT delegate tool actions to external secondary LLMs unless explicitly invoked via verified MCP endpoint.

2. Context Conservation:
   - Do NOT re-read or dump unmodified configuration files on every iteration.
   - For file modifications, output precise diff chunks instead of whole-file rewrites.

3. Negative Constraints & Deletion Protection:
   - "Disable feature" MUST be interpreted as disabling logic (e.g., commenting out, flipping boolean flags, or setting feature toggle to false).
   - NEVER execute `rm`, `unlink`, or delete files/routes unless the prompt explicitly contains the word "DELETE" or "REMOVE".
   - If unsure between disabling vs deleting, STOP and ask the user for confirmation.

Testing/workflow steps

  1. Configure the provider in opencode.json as an OpenRouter alias with the @ai-sdk/alibaba adapter to ensure requests pass through cache-hit headers.

  2. Audit all directives in AGENTS.md / CLAUDE.md: ensure every tool name referenced by a rule matches the model's actual callable tool list verbatim (Verbatim matching ).

  3. Run a small-scale test: execute 3 code retrieval and modification interactions, and monitor via proxy logs whether input tokens grow linearly on each turn (uncached ) or only increase by deltas (cache hit ).

  4. Monitor Time to First Token (TTFT ) and output token generation speed across multi-turn conversations; immediately trigger an Early Stop if the model repeatedly re-interprets specifications or enters tool-invocation loops.

Original evidence and data

  • Empirical test log by community user Unable_Strategy: using the standard OpenRouter configuration to call Qwen3.7-Max directly in OpenCode CLI consumed $4.00 in API credits within 8 minutes (134 requests generating 8,236,560 input tokens and 40,903 output tokens ) because the entire project context was reloaded on every interaction without hitting the cache.

  • Debugging revealed that OpenCode CLI's cache-header injection relies on SDK detection; specifying npm: "@ai-sdk/alibaba" successfully activates server-side Prompt Caching, dramatically cutting repetitive input token costs.

  • Architectural analyst Deep_Ad1959 pointed out: when the Qwen3 series parses multi-layered natural language agent rules, if tool descriptions in instructions do not match the actually provided Tool Schema verbatim, the model tends to degrade instructions into open-ended rewrites, triggering long-context loops.

Scope and limitations

  • This configuration relies on the Prompt Caching implementation of OpenRouter and Alibaba-compatible endpoints; third-party private proxies will not work if they do not support cache-header passthrough.

  • Rule-based constraints reduce the probability of unintended operations, but extremely complex negative instructions (such as configuration changes containing double negatives ) still require sandboxing and human-in-the-loop confirmation mechanisms.

Source excerpt or observation (brief excerpt for compliance only )

A core community discussion noted: "8.2M input on 3 prompts is the agent.md getting re-read with most of the repo on every turn... grep your agent.md for every directive that depends on a tool name, and check if that tool name appears verbatim".

Source and dates

Reddit (r/opencodeCLI & r/QwenAI ) · Source date: 2026-05-25 · Edited: 2026-09-20

Read the original source
Variable checklist

No required variables

Related prompts

Qwen3.7-Max: Long-Horizon Agent Prompts and Acceptance Closed Loop for GPU Kernel OptimizationQwen3.7-Max: Long-Horizon Agents, Frontend Prototypes, and Office PromptsQwen3.7-Max: Alibaba Cloud Model Studio Versions, Pricing, and Cache ConfigurationQwen3.7-Max: Multi-Model Collaborative Routing Configuration for Code Reading and Review

Related reviews

Qwen3.7-Max: Official Complete Benchmarks and 35-Hour Autonomous Optimization ExperimentQwen3.7-Max: BenchLM Public Evidence Coverage and Speed LedgerQwen3.7-Max vs. Qwen3.7-Plus: Cost and Quality on Three Real TasksQwen3.7-Max: Artificial Analysis Intelligence Index, Cost, and Speed Benchmark

Read the full analysis

Overview · English

Qwen3.7 Max: What It Is, Access Routes, and Where It Fits

A sourced Qwen3.7 Max overview covering the dated snapshot, one-million-token API boundary, agentic use cases, pricing separation, and practical risks.

Qwen3.7 Max

Use Qwen3.7 Max in Tabbit

Run this guide in the environment listed above. Downloading does not transfer the template or establish model availability for your account.