โ—† Vibe EngineeringSMIT ยท AI Agentic Engineering
Class 6 ยท 6.3

OpenCode: run free models like GLM 4.7

An open-source alternative to Claude Code โ€” the easiest way to try genuinely free, near-frontier models, and to connect any provider you like.

๐ŸŽฏ Goal: run a free-model code reviewโฑ Read: 8 min๐Ÿงญ Type: tools

01What OpenCode is โ€” and how to install it

And now for something completely different: OpenCode (opencode.ai). It's a popular open-source competitor to Claude Code, and the easiest way to use genuinely free models โ€” with free models included out of the box, plus the ability to connect any model from any provider (Claude, GPT, Gemini and more).

Installation looks familiar. You can use the one-line installer for your OS, or โ€” since we already have Node โ€” install it with npm. On Windows, choco is the easy route; otherwise npm works everywhere.

VS Code ยท terminal
# install (npm route โ€” Node already installed):
npm install -g opencode-ai
# then, inside your project:
cd your-project
opencode

Open the PM project again, open a fresh terminal so it picks up the new PATH, and run opencode to launch.

02Models and modes

The first thing you notice: OpenCode detects environments you're already signed in to. Here it spotted an existing OpenAI subscription and opened with GPT-5.2 selected. A few key controls:

Tab

Plan โ†” Build

Switch between the two agent modes โ€” think first, or act.

Ctrl + T

Reasoning level

Cycle low โ†’ medium โ†’ high โ†’ extra-high. GPT-5.2 can go far more thoughtful than the "high" we capped at in Copilot.

/models

Switch model

Like Claude Code, a slash opens commands. /models lets you change the model.

Scroll the model list and you'll find the free open-source all-stars:

ModelFromReputation
GLM 4.7Z.ai (Zhipu, China)Incredibly powerful; lots of excitement around it.
Kimi K2 / K2.5Moonshot AIArguably the strongest open-source model right now.
MiniMaxMiniMaxAnother genuinely strong open-source option.

03A free code review with GLM 4.7

Let's pick GLM 4.7 and get our first taste of a free model. Put it in plan mode (Tab), delete any existing review first so it gets no hints, then ask:

Please review the entire project, carry out a code review, and write your feedback to code-review.md in the docs directory.

Off it goes โ€” its own distinct look, but plenty in common with Claude Code: a thinking indicator, scanning files, all running for free on GLM 4.7. Because it's in plan mode it thinks without acting, so switch to build mode to actually write the file:

Please go ahead and write the code review to docs/code-review.md, but don't start any further work yet.

Context climbs from ~34% to ~37%, and the review lands: an executive summary ("overall assessment: good"), strengths (modular architecture), and real findings โ€” hard-coded auth credentials, TypeScript strictness, some code duplication, error handling. A long, genuinely impressive document.

Impressive โ€” but not frontier

Even a well-regarded model like GLM 4.7 is far from the very frontier. The review reads well, but you typically won't get the same independence and reliability โ€” it's doubtful it could have implemented and refactored all the changes as cleanly as Claude Opus 4.5 did.

"Free" has fuzzy limits

OpenCode isn't entirely clear about the free allowance โ€” there's no visible quota right now. Use it a lot and you may slow down, get rate-limited, or hit an error. This is liable to change; they might not always offer these free models.

04Connecting other providers

/models shows what you can reach; /connect adds a new provider. By default you're on OpenCode Zen โ€” their curated set of free models โ€” plus anything it auto-detected (OpenAI, in this case).

OpenCode Zen (free)OpenAI Anthropic (Max or API key)GitHub Copilot GoogleAzureBedrock LM StudioOpenRouterOllama (local)

You can point it at OpenRouter with your key (a great way to run free or cheap models), or at models running locally via Ollama โ€” but local needs a serious machine: at least 64 GB of GPU RAM (or 64 GB unified memory on a Mac), since gpt-oss-20B isn't enough and you'd want gpt-oss-120B. Few people can run that.

The practical recommendation

For free models, use the ones offered through OpenCode Zen, or connect OpenRouter with your key. Almost everything you do in Claude Code, you can do in OpenCode too โ€” with more flexibility to switch between (and run multiple) models in a session.

Lots of people love OpenCode. The instructor's favourite is still Claude Code โ€” the whole platform is organised around what Claude's models are effective at โ€” but you can follow the entire course in OpenCode if you prefer.

โœ“ Key takeaways

  • OpenCode is an open-source Claude Code alternative โ€” the easiest way to run genuinely free models, or connect any provider.
  • Install via npm (or the OS installer), then run opencode in your project; Tab = plan/build, Ctrl+T = reasoning level.
  • Free all-stars: GLM 4.7, Kimi K2.5, MiniMax โ€” impressive, but not frontier-reliable.
  • Plan mode thinks before acting; switch to build mode to actually write files.
  • Use /connect for other providers; the best free routes are OpenCode Zen or OpenRouter โ€” local Ollama needs a very beefy machine.