← All posts

Agentic AI on Campus: Powering Claude Code with MindRouter

How we run autonomous coding agents on local GPU infrastructure — faster, cheaper, and without sending a single byte off campus.


There is a quiet revolution happening in how developers interact with large language models. The era of copy-pasting snippets into a chat window is giving way to something far more powerful: agentic workflows, where an AI assistant doesn't just answer your question — it picks up tools, reads your codebase, writes files, runs tests, and iterates until the job is done.

Tools like Anthropic's Claude Code have become the reference implementation for this pattern. From the command line, Claude Code can autonomously navigate a repository, edit files across dozens of modules, execute shell commands, and orchestrate multi-step tasks that would take a human developer hours. It is, in a very real sense, a junior developer that never sleeps.

But here's the thing most people don't realize: Claude Code doesn't have to talk to Anthropic's servers. With a few environment variables, you can point it at any inference backend that speaks the right API protocol — including one running on GPUs down the hall from your office. In our case, that backend is MindRouter, and the combination is turning out to be a game-changer.

What Is MindRouter?

MindRouter is an institutional LLM inference platform. It sits on top of a cluster of university-owned GPUs — currently 31 backend nodes serving over 60 models — and exposes them through industry-standard APIs. If your code can talk to OpenAI, Ollama, or Anthropic's Messages API, it can talk to MindRouter without modification.

The platform handles load balancing, fair-share scheduling, and full observability across the cluster. It has served over two billion tokens to date. And critically, every byte of data stays on university infrastructure. There is no cloud provider in the loop. No training on your prompts. No third-party data processing agreement to worry about.

Choosing the Right Model for Agentic Work

Not all language models are created equal when it comes to agentic tasks. A model that writes beautiful prose may fall apart when asked to produce a structured tool call, follow a multi-step plan, or recover gracefully when a shell command returns an unexpected error. Agentic work demands a model that is strong at instruction following, tool use, structured output, and long-context reasoning — all at once.

You really need to choose a reasoning model with a long context window, with at least 64K tokens. Preferably 128K tokens or more.

This is where model selection becomes critical, and where Qwen 3.5 122B or 400B stands out as an exceptional choice for local deployment.

Qwen 3.5 (122B or 400B) is a Mixture-of-Experts model from Alibaba's Qwen team that has been specifically trained with agentic capabilities in mind. It handles tool calling natively, produces well-formed structured outputs reliably, and maintains coherence across the kind of extended, multi-turn interactions that define agentic coding sessions. On MindRouter, it runs across multiple GPUs using tensor parallelism, and the cluster's load balancer ensures that even under contention, requests are routed efficiently.

Could you use a smaller model? Sure. MindRouter offers models ranging from 0.5M to 400B parameters. But if you are asking an agent to autonomously refactor a module, write tests, and debug failures in a loop, you want the strongest reasoning model you can get. The 400B class is where the reliability curve bends sharply upward, and Qwen 3.5 sits at the top of that class for open-weight models. The 122B Qwen 3.5 model is nearly as capable as the 400B model, but provides significantly more throughput and less latency.

Setting It Up: Three Environment Variables and Go

The elegance of this setup is in its simplicity. Claude Code respects a small set of environment variables that redirect its API calls. To point it at MindRouter, you need just a few lines in your shell profile:

# Point Claude Code at MindRouter's Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL="https://mindrouter.example.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-mindrouter-api-key"

# Tell Claude Code which model to use
export ANTHROPIC_MODEL="qwen/qwen3.5-122b"

That's it. The next time you invoke claude from your terminal, every request flows through MindRouter instead of Anthropic's cloud. The model name maps directly to what's available on the cluster, and your API key is the one you generate from the MindRouter dashboard after authenticating with your university credentials.

For more granular control, you can also set model defaults by tier:

# Use the 400B for heavy reasoning, a smaller model for quick tasks
export ANTHROPIC_DEFAULT_SONNET_MODEL="openai/gpt-oss-120b"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="openai/gpt-oss-20b"

Or, if you prefer to keep your shell clean, drop the configuration into ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://mindrouter.example.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "your-mindrouter-api-key",
    "ANTHROPIC_MODEL": "qwen/qwen3.5-122b"
  }
}

Either way, the switch is seamless. Claude Code's interface, tool use, and agentic loop all work exactly as documented — just backed by local iron instead of a distant data center.

A Practical Example: Refactoring a Research Pipeline

Let's make this concrete. Imagine you're a graduate student working on a bioinformatics pipeline written in Python. The code works, but it's a single 800-line script with no tests, hardcoded paths, and functions that do six things at once. You've been meaning to clean it up for months.

With Claude Code pointed at MindRouter, you open a terminal in your project directory and type:

claude "Refactor pipeline.py into a proper package structure with separate
modules for data loading, alignment, and visualization. Add type hints,
docstrings, and pytest unit tests for each module. Keep the existing
behavior identical."

What happens next is not a single API call. Claude Code reads your file, develops a plan, creates a package directory, writes module files one at a time, moves functions into the appropriate modules, updates imports, writes a test suite, runs pytest to verify nothing broke, and iterates if tests fail. This might involve dozens of LLM calls and tool invocations over ten or fifteen minutes.

Every one of those calls hits MindRouter. The data — your unpublished research code, your file paths, your test output — never leaves the university network. And because MindRouter's scheduling is fair-share rather than pay-per-token, you're not watching a billing meter tick up with every request.

The Economics: Why Local Inference Changes the Calculus

Let's talk about cost, because it matters more than people admit.

Agentic workflows are token-hungry. A single Claude Code session that refactors a module might consume hundreds of thousands of tokens across its planning, editing, and verification steps. At commercial API rates, a busy developer can easily run up hundreds of dollars a month in inference costs. For a research lab with five students and a postdoc, that adds up fast.

MindRouter runs on infrastructure the university already owns, funded in part by the National Science Foundation. There are no per-token charges. The marginal cost of your next million tokens is effectively the electricity to run the GPUs — a rounding error compared to commercial API pricing. This changes the way you use the tool. You stop rationing your requests. You let the agent iterate more freely. You run it on speculative tasks ("see if you can find a better algorithm for this") that you'd never burn commercial tokens on.

The result is that researchers and students actually use agentic AI in their daily work, rather than treating it as a special occasion.

Data Sovereignty: Keeping Research on Campus

For many university researchers, the cost argument is secondary to the data argument. If you work with IRB-protected human subjects data, FERPA-covered student records, pre-publication research, proprietary datasets from industry partners, or anything governed by an export control regulation, sending that data to a commercial API endpoint is somewhere between "complicated paperwork" and "flatly prohibited."

MindRouter sidesteps this entirely. The inference cluster is on university-managed infrastructure, behind university authentication, with university-controlled audit trails. Your prompts are not stored for model training. Your data does not leave the institutional boundary. For compliance-sensitive work, this isn't a nice-to-have, it's a prerequisite.

NOTE: Our MindRouter deployment has not yet been approved for higher risk data, but we're actively working on making that happen.

Beyond Coding: Other Agentic Patterns

While Claude Code is the most vivid example, the same MindRouter backend can power any agentic framework that speaks OpenAI-compatible or Anthropic-compatible APIs. LangChain agents, LlamaIndex pipelines, custom Python scripts using the OpenAI SDK — all of them can be pointed at MindRouter with the same base URL and API key pattern:

from openai import OpenAI

client = OpenAI(
    base_url="https://mindrouter.example.com/v1",
    api_key="your-mindrouter-api-key"
)

response = client.chat.completions.create(
    model="qwen/qwen3.5-122b",
    messages=[{"role": "user", "content": "Analyze this dataset..."}],
    tools=[...],  # your custom tool definitions
)

MindRouter supports tool calling, streaming, and structured output natively — the building blocks of any agentic system. The cluster doesn't care whether the request comes from Claude Code, a Jupyter notebook, or a cron job running at 3 a.m.

Getting Started

Getting started takes about five minutes:

  1. Log in to mindrouter.example.com with your university credentials.
  2. Generate an API key from the dashboard.
  3. Set your environment variables as shown above.
  4. Install Claude Code (npm install -g @anthropic-ai/claude-code) if you haven't already.
  5. Run claude in any project directory and start working.

The MindRouter documentation at mindrouter.example.com/documentation covers advanced topics like rate limits, model selection, and integration with other frameworks.

The Bigger Picture

There's a broader point here that goes beyond any single tool. Universities have always been places where powerful computing infrastructure is shared as a commons — from the mainframe era through HPC clusters to cloud credits programs. MindRouter extends that tradition to AI inference. It takes the most capable open-weight models available, runs them on institutional hardware, and makes them accessible through the same APIs that the commercial world uses.

The combination of agentic tooling like Claude Code with local inference infrastructure like MindRouter is, in a word, liberating. It means a graduate student with a good idea and a terminal can wield the same caliber of AI-assisted development that a well-funded startup takes for granted — without the bill, without the compliance headaches, and without sending their work into someone else's cloud.

The GPUs are already here. The models are already running. The environment variables take thirty seconds to set. The only question left is what you'll build.


MindRouter is developed and maintained at the University of Idaho with support from the National Science Foundation. For questions, access requests, or to learn more, visit mindrouter.example.com.