The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.
1. Install OpenCode
curl -fsSL https://opencode.ai/install | bash
| { | |
| "meta": { | |
| "lastTouchedVersion": "2026.1.30", | |
| "lastTouchedAt": "2026-02-01T16:48:36.938Z" | |
| }, | |
| "wizard": { | |
| "lastRunAt": "2026-02-01T16:48:36.935Z", | |
| "lastRunVersion": "2026.1.30", | |
| "lastRunCommand": "onboard", | |
| "lastRunMode": "local" |
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
| Description | Syntax |
|---|---|
| Get the length of a string | ${#VARNAME} |
| Get a single character | ${VARNAME[index]} |
| # this file contains keys needed for decryption of file system data (WUD/WUX) | |
| # 1 key per line, any text after a '#' character is considered a comment | |
| # the emulator will automatically pick the right key | |
| 541b9889519b27d363cd21604b97c67a # example key (can be deleted) | |
| d7b00402659ba2abd2cb0db27fa2b656 # Common | |
| 805e6285cd487de0faffaa65a6985e17 # Espresso Ancast | |
| b5d8ab06ed7f6cfc529f2ce1b4ea32fd # Starbuck Ancast | |
| 9a164ee15ac7ceb64d3cc130094095f6 # 007 Legends [EUR, NUS] |
This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.
Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK from newest Visual Studio.
You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.
To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.
To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).