opencode + Ollama + Qwen3.6をWindows環境に構築してみた I Set Up opencode + Ollama + Qwen3.6 on Windows
はじめに
Claude Code のようなAIコーディングアシスタントをローカルのLLMで動かせないか試してみました。今回使ったのは opencode(旧称 sst/opencode)、ローカルLLMランナーの Ollama、そしてAlibaba Cloudが開発した Qwen3.6 です。
Qwen3.6とは?
Alibabが開発したQwen(通義千問)シリーズの最新世代。qwen3.6:latestは35Bパラメータのモデルで、コーディング・ツール呼び出し・思考(thinking)モードをサポートします。モデルサイズは約24GB、コンテキストウィンドウは256Kトークンと大規模です。
用意するもの
- Windows 10/11
- Node.js (npm が使える状態)
- winget(Windows標準のパッケージマネージャー)
- 十分なストレージ空き容量(モデルダウンロードに約24GB必要)
手順
1. opencodeをインストール
opencode はnpmでグローバルインストールできます。
npm i -g opencode-ai@latest
インストール後は opencode コマンドが使えるようになります。
2. Ollamaをインストール
winget を使ってOllamaをインストールします。パッケージIDは Ollama.Ollama です。
irm https://ollama.com/install.ps1 | iex
インストールが完了すると、Ollamaがバックグラウンドサービスとして起動し、http://localhost:11434 でAPIが利用可能になります。
3. モデルをダウンロード・起動
ollama run qwen3.6:latest
注意: qwen3.6:latest は約24GBのダウンロードが発生します。通信環境によっては時間がかかります。ダウンロード後、Ollamaのシェルが起動しそのまま対話できます。確認できたら Ctrl+D で終了して構いません。
4. opencodeの設定ファイルを作成
以下のパスに設定ファイルを作成します。
%USERPROFILE%\.config\opencode\opencode.json
フォルダが存在しない場合は作成してください。
mkdir "%USERPROFILE%\.config\opencode"
設定ファイルの内容は以下のとおりです。
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama (local)",
"options": {
"baseURL": "http://127.0.0.1:11434/v1"
},
"models": {
"qwen3.6:latest": {
"name": "Qwen 3.6 (local)"
}
}
}
},
"model": "ollama/qwen3.6:latest"
}
ポイント:
npmに指定する@ai-sdk/openai-compatibleは、OllamaがOpenAI互換APIを提供しているため使用します。baseURLはOllamaのデフォルトエンドポイントです。- OllamaはAPIキー認証が不要なため、
auth.jsonの設定は不要です。
5. opencodeを起動
プロジェクトのディレクトリで以下を実行します。
opencode
TUIが起動し、Qwen3.6を使ってコーディングアシスタントとして利用できます。
実際に使ってみた感想
動作はしました。opencodeのインターフェースからQwen3.6に指示を出してコードを生成させることができます。
問題はVRAMです。
私のマシンのVRAMは 2GB しかありません。qwen3.6:latest は35Bパラメータ・24GBのモデルなので、GPU側に載せられる部分はほんのわずかで、残りはすべてシステムRAM上でCPU処理になります。結果として体感できるほど遅く、実用的には厳しい状況でした。
賢さはそれなりで、コーディング支援の質自体は悪くなかったです。VRAMさえ積んでいれば十分使えるでしょう。
VRAMの目安
| モデル | サイズ | 快適に動かすためのVRAM目安 |
|---|---|---|
| qwen3.6:latest (35B) | 24GB | 24GB以上(RTX 4090 × 2など) |
| qwen3:8b | 5.2GB | 8GB以上(RTX 3070など) |
| qwen3:4b | 2.6GB | 4GB以上 |
軽量モデルから試したい場合は qwen3:4b や qwen3:8b がおすすめです。
まとめ
- opencode + Ollama + Qwen3.6の組み合わせはWindows上でも問題なく動作した
- 設定ファイル1つで完結する構成はシンプルで分かりやすい
qwen3.6:latestは35B・24GBの大規模モデルのため、VRAMが潤沢でないと実用的な速度は出ない- 今回は速度の問題からClaude Codeに戻したが、十分なGPUがあれば有力な選択肢になりうる
ローカルLLMで完全オフライン・無料のAIコーディング環境を試してみたい方はぜひ挑戦してみてください。
Introduction
I wanted to see whether I could run an AI coding assistant like Claude Code on a local LLM. This time I used opencode (formerly sst/opencode), the local LLM runner Ollama, and Qwen3.6, developed by Alibaba Cloud.
What is Qwen3.6?
The latest generation of Alibaba’s Qwen (Tongyi Qianwen) series.qwen3.6:latestis a 35B-parameter model that supports coding, tool calling, and a thinking mode. It’s a big model: about 24GB in size, with a 256K-token context window.
What You Need
- Windows 10/11
- Node.js (with npm available)
- winget (the standard Windows package manager)
- Plenty of free storage (the model download needs about 24GB)
Steps
1. Install opencode
opencode can be installed globally with npm.
npm i -g opencode-ai@latest
After installation, the opencode command is available.
2. Install Ollama
Install Ollama with winget. The package ID is Ollama.Ollama.
irm https://ollama.com/install.ps1 | iex
When installation finishes, Ollama starts as a background service and its API is available at http://localhost:11434.
3. Download and Run the Model
ollama run qwen3.6:latest
Note: qwen3.6:latest is about a 24GB download. Depending on your connection, it can take a while. After the download, the Ollama shell starts and you can chat with the model right away. Once you’ve confirmed it works, you can exit with Ctrl+D.
4. Create the opencode Settings File
Create a settings file at the following path.
%USERPROFILE%\.config\opencode\opencode.json
If the folder doesn’t exist, create it.
mkdir "%USERPROFILE%\.config\opencode"
The settings file looks like this.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama (local)",
"options": {
"baseURL": "http://127.0.0.1:11434/v1"
},
"models": {
"qwen3.6:latest": {
"name": "Qwen 3.6 (local)"
}
}
}
},
"model": "ollama/qwen3.6:latest"
}
Key points:
@ai-sdk/openai-compatiblegoes innpmbecause Ollama provides an OpenAI-compatible API.baseURLis Ollama’s default endpoint.- Ollama doesn’t need API key authentication, so there’s no need to set up
auth.json.
5. Start opencode
Run the following in your project directory.
opencode
The TUI starts, and you can use it as a coding assistant backed by Qwen3.6.
How It Went in Practice
It worked. From the opencode interface, I could give Qwen3.6 instructions and have it generate code.
The problem is VRAM.
My machine has only 2GB of VRAM. qwen3.6:latest is a 35B-parameter, 24GB model, so only a tiny part of it fits on the GPU and the rest runs on the CPU from system RAM. As a result, it was noticeably slow and hard to use for real work.
It was reasonably smart, and the quality of the coding help itself wasn’t bad. With enough VRAM, it would be perfectly usable.
VRAM Guidelines
| Model | Size | VRAM for comfortable use |
|---|---|---|
| qwen3.6:latest (35B) | 24GB | 24GB or more (e.g. 2 × RTX 4090) |
| qwen3:8b | 5.2GB | 8GB or more (e.g. RTX 3070) |
| qwen3:4b | 2.6GB | 4GB or more |
If you’d like to start with a lighter model, I recommend qwen3:4b or qwen3:8b.
Summary
- opencode + Ollama + Qwen3.6 ran without problems on Windows
- The setup fits in a single settings file, which is simple and easy to follow
qwen3.6:latestis a large 35B, 24GB model, so without plenty of VRAM it won’t reach a practical speed- This time I went back to Claude Code because of the speed, but with a capable enough GPU it could be a strong option
If you’d like to try a fully offline, free AI coding setup on a local LLM, give it a go.
関連記事 Related Posts
Ryzen AI PCのローカルLLMを7倍速くした話(llama.cpp + Vulkan + Qwen) How I Made the Local LLM on My Ryzen AI PC 7 Times Faster (llama.cpp + Vulkan + Qwen)
まっさらにしたRyzen AI 9 HX 370機に、llama.cppとVulkanでローカルLLM環境を作り直しました。CPU推論から約7倍。最新モデルを選んで失敗した話と、ファイルが大きいほうが速いという実測結果をまとめます。 I rebuilt the local LLM setup on my freshly wiped Ryzen AI 9 HX 370 machine with llama.cpp and Vulkan: about 7 times faster than CPU inference. Here's how picking the newest model backfired, and measurements showing the bigger file was faster.
WSLからホストのローカルLLMを使う方法を調べて、やめた I Looked into Using the Host's Local LLM from WSL, and Decided Not To
WSL上の開発でWindowsホストのローカルLLMをレビュアーとして使いたい。経路は2つあり、どちらも実現はできます。ただし片方は安全性を、もう片方は信頼性を差し出す必要があったので見送りました。その判断の記録です。 I wanted to use the local LLM on my Windows host as a reviewer for development in WSL. There are two routes, and either one can be made to work. But one meant giving up safety and the other meant giving up reliability, so I passed. This is a record of that decision.
Ryzen AI PCのローカルLLM環境を一度まっさらにする Wiping the Local LLM Setup on My Ryzen AI PC Clean
AMD Ryzen AI 9 HX 370搭載機に積み上げたローカルLLM環境を、最新の方法で組み直すために一度全部消します。何が残っているかの棚卸しから、削除の手順、消してはいけないものまでをまとめました。 To rebuild the local LLM setup I had piled up on my AMD Ryzen AI 9 HX 370 machine with the latest approach, I'm deleting it all first. I cover taking inventory of what's left, the removal steps, and what you shouldn't delete.