ChanhDocumentation v0.1.4 Install
On this page

VS Code extension · Local inference

Chanh /ch-ahn/

Chanh downloads, hosts and runs a Lemonade Server locally, then exposes the models it serves to VS Code. It is an integration layer for the editor: server lifecycle, model management, chat, agent mode and runtime visibility. Model execution is handled by Lemonade.

Version 0.1.4 VS Code ≥ 1.140 MIT Windows · macOS · Linux

The extension contributes a Chanh activity-bar view (CHANH_SIDEBAR → CHANH_TREEVIEW), a Model Info webview, the @chanh chat participant, and a VS Code language-model provider registered under the chanh vendor. In LEMONADE and LEMOND modes, prompts and code stay on the machine.

Local by default

Chanh has no account, no hosted inference and no cloud fallback. Requests go only to the configured Lemonade endpoint. A CUSTOM URL is the exception — traffic goes wherever you point it.

At a glance

Extension IDlanly-dev.chanh
Publisherlanly-dev
Version0.1.4
Engine^1.140.0
ActivationonStartupFinished
Chat participantCHANH_CHAT — @chanh
Model providerVS Code language-model vendor chanh
Repositorylanly-dev/lemond
02

Architecture #

Chanh sits between VS Code and Lemonade Server. The server exposes an OpenAI-compatible HTTP API; the extension translates that API into tree data, webviews, chat responses and VS Code language-model parts.

Process model

ComponentSourceResponsibility
ServerManagersrc/serverManager.tsActive server, health, ports and lifecycle. Starts/stops only the managed lemond process.
LemonadeClientsrc/lemonadeClient.tsHTTP and wire-format translation for health, models, system info, pull, load, unload and options.
ModelManagersrc/modelManager.tsDownloads, load/unload, context-size overrides, backend selection, model info and endpoint configuration.
ServerViewProvidersrc/serverTreeview.tsTree model, section state, capability grouping, filters and persisted view preferences.
ChanhLmcProvidersrc/lmcProvider.tsVS Code LanguageModelChatProvider used by the native model picker and agent mode.
ChatParticipantsrc/chatParticipant.ts@chanh, slash commands, streaming responses and token usage.
SystemMonitorsrc/systemMonitor.tsCPU, GPU and memory sampling for the sidebar System group.
BinaryManagersrc/binaryManager.tsDownload and update of the managed lemond binary.

Data flow

  1. The selected server mode resolves a base URL — system Lemonade, managed lemond, or a custom URL.
  2. /v1/health and /v1/models populate the tree. /v1/system-info supplies recipes and backend install state.
  3. Loading, unloading, pulling and context/backend changes are sent to the server; the tree reflects the returned state.
  4. Chat and native model requests stream from Lemonade and are translated into VS Code response parts.

External servers (LEMONADE, CUSTOM) are connected to, not terminated, when the extension deactivates.

03

Requirements #

EditorVS Code 1.140 or newer.
PlatformWindows, macOS or Linux. Lemonade must support the selected backend on that platform.
ServerA running Lemonade Server (system install), the managed lemond binary, or a reachable custom URL.
NetworkRequired to download the server binary and models. Not required for inference once the model is local.
HardwareCPU is sufficient. CUDA, Vulkan or ROCm can be selected for supported recipes. Model weights need disk space.
LicensesThe extension is MIT. Each model has its own license; review it before downloading.
Model support depends on Lemonade

Chanh does not bundle model runtimes. Available backends and model recipes come from the installed Lemonade Server and the platform it runs on.

04

Installation #

Install from the Marketplace, Open VSX, or the VS Code CLI:

bash
code --install-extension lanly-dev.chanh
  1. Open the Chanh icon in the activity bar.
  2. Choose the server mode. LEMONADE connects to an existing system server; LEMOND lets Chanh manage its binary; CUSTOM uses a configured URL.
  3. Download or load a chat-capable model from the tree.
  4. Type @chanh in chat, or select a Chanh model in the native picker for agent mode.

The default server mode is LEMONADE on port 13305. See Configuration to change it.

05

Server modes #

Server selection is controlled by chanh.serverMode. The tree always shows the active server only.

ModeDefault URLLifecycleUse when
LEMONADEhttp://localhost:13305External; Chanh connects onlyYou already run Lemonade Server system-wide.
LEMONDhttp://localhost:8000Managed by ChanhYou want the extension to download, start and stop the bundled binary.
CUSTOMConfigured URLExternal; Chanh connects onlyThe server runs elsewhere or on a non-default host/port.

Ports are configured with chanh.lemonadePort and chanh.lemondPort. The managed binary is stored in global storage and can be revealed from the server header context actions.

Start/stop behavior

Start Server and Stop Server only control the managed lemond process. In LEMONADE and CUSTOM modes, manage the server outside Chanh.

06

Model lifecycle #

The tree is a view over the active server. Sections collapse and expand independently; grouping and filters are persisted per workspace.

Tree sections

SectionContent
ServerStatus, URL, version, maximum loaded models, backends/recipes and pinned models.
SystemCPU, GPU and memory samples. Only rendered while the configured endpoint is local; cadence is chanh.systemSampleInterval.
Loaded ModelsModels currently resident in the server, with idle/busy state.
Downloading ModelsActive pulls and locally tracked partial downloads. Progress is streamed from /v1/pull.
Installed ModelsDownloaded models, grouped by capability or shown flat. Load, inspect, tune, or remove.
Downloadable ModelsCatalog from the server. A hot-only filter and sub-capability filters are available.

States and actions

StateMeaningAvailable actions
DownloadableKnown to the catalog but not on disk.Download; inspect metadata.
InstalledWeights are on disk, not loaded.Load, show info, select backend, remove.
LoadedResident in the server; may be idle or busy.Unload, show info, add to chat endpoints.
PartialAn interrupted pull tracked by the extension.Retry or remove the partial file.

Downloads are extension-owned: progress comes from the streaming pull response and incomplete pulls are persisted in workspace state. This means a download started by another client, or completed while VS Code was closed, is not reconciled automatically.

Capability labels

Labels come from the server and drive grouping, filters and picker eligibility. Matching is case-insensitive.

LabelBehavior
chat / llmMakes a model eligible for chat. The two labels are treated as equivalent.
tool-callingRequired for the model to appear in the native picker for agent mode.
visionAdds image-attachment support in chat and the picker.
embeddings, rerankingGrouped under their capability categories.
transcription, tts, image, 3dGrouped by capability; exposed according to the server's recipes.
omniMulti-modality collection. Listed in its own group and in other matched groups.
hotHighlights suggested/hot models in the downloadable catalog.

Context and backend

  • Context size — presets from 8K to 128K, Automatic (-1), or a custom value. Saved per model as a ctx_size recipe option.
  • Backend — selected per recipe (for example CPU, CUDA, Vulkan). The choice is remembered for every model using that recipe.
  • Model Info — capabilities, status, size, effective/reported/default context, maximum window, checkpoint, registry, recipe, owner, creation data and the live backend endpoint.

Server endpoints used

EndpointUsed for
/v1/healthStatus, loaded models, busy/streaming state and pinned models.
/v1/modelsCatalog, labels, sizes, download status and model metadata.
/v1/system-infoRecipes, backend install state and backend/device information.
/v1/pullStreaming model download progress.
/v1/load · /v1/unloadModel residency.
/v1/models/{model}/optionsSaved, effective and default recipe options for context and backend.
07

Configuration #

SettingDefaultDescription
chanh.chatModel(unset)Model used by @chanh. Empty prompts for a model.
chanh.customServerUrl(unset)URL used when chanh.serverMode is CUSTOM.
chanh.lemonadePort13305Port for the system-installed Lemonade Server.
chanh.lemondPort8000Port for the managed lemond binary.
chanh.maxLoadedModels(unset)Maximum number of loaded models. Use -1 for unlimited.
chanh.serverModeLEMONADELEMONADE, LEMOND or CUSTOM.
chanh.showTokenStatsfalseShow per-turn token counts from the model's usage block.
chanh.systemSampleInterval5Seconds between CPU/GPU/RAM samples.

Example settings

json
{
  "chanh.serverMode": "LEMONADE",
  "chanh.lemonadePort": 13305,
  "chanh.chatModel": "Qwen3.5-4B-MTP-GGUF",
  "chanh.showTokenStats": true,
  "chanh.systemSampleInterval": 5
}
08

Chat and agent mode #

There are two integration surfaces. Both use the active Lemonade server and the selected model.

SurfaceBehavior
@chanh participantSends the request directly to Lemonade, streams the reply and supports /fix and /explain. Uses chanh.chatModel or prompts for a chat model.
Native model pickerRegisters a VS Code language-model provider under Chanh 🍋. Lists chat models that also advertise tool-calling; vision models accept images.
Agent modeVS Code orchestrates the loop. Chanh forwards tool definitions and translates tool calls; tools are not executed by the provider.
chat
@chanh /explain
  • Model selection — chanh.chatModel remembers the model used by @chanh. Leave it empty to be prompted.
  • Token stats — enabled by chanh.showTokenStats; the final stream chunk supplies prompt/completion counts.
  • Vision — labels containing vision expose image attachments in the picker.
  • Custom endpoint — the command Add Entry to VS Code's Chat Custom Endpoints writes a single loaded model into chat.customEndpoints.
Offline after download

Once the server and weights are present locally, inference does not require a network connection. Model selection and chat both use the local endpoint.

09

Commands #

Chanh: commands are available in the command palette. Item commands (chanh.ncp.*) appear in model context menus or inline hover actions and may be hidden from the palette.

Server and setup

CommandAction
chanh.startServerStart the managed server.
chanh.stopServerStop the managed server.
chanh.switchServerSwitch the active server mode.
chanh.refreshServerRefresh server status and model data.
chanh.editServerPortEdit the port or custom URL.
chanh.openServerUrlOpen the active server URL.
chanh.downloadBinaryDownload or update the managed binary.
chanh.setMaxLoadedModelsSet the server's loaded-model limit.
chanh.selectChatModelSelect and load a model for chat.
chanh.openSettingsOpen VS Code settings filtered to Chanh.
chanh.openLmConfigsFileOpen the chat language-models configuration.
chanh.ncp.revealBinaryDirReveal the managed binary folder.

Model actions

CommandAction
chanh.ncp.downloadModelPull a downloadable model.
chanh.ncp.cancelDownloadCancel an active pull.
chanh.ncp.loadModelLoad an installed model.
chanh.ncp.unloadModelUnload a loaded model.
chanh.ncp.removeModelDelete a model from disk.
chanh.ncp.showModelInfoOpen the Model Info webview.
chanh.ncp.copyModelIdCopy the model identifier.
chanh.ncp.setModelContextSet a context-size override.
chanh.ncp.resetModelContextReset the context override.
chanh.ncp.selectBackendChoose the backend for the model's recipe.
chanh.ncp.uninstallBackendUninstall a backend.
chanh.ncp.configLmEndpointAdd a loaded model to VS Code chat endpoints.

View and filtering

CommandAction
chanh.ncp.toggleModelSectionsHideHide Installed and Downloadable sections.
chanh.ncp.toggleModelSectionsShowShow Installed and Downloadable sections.
chanh.ncp.toggleModelGroupingGroup installed models by capability.
chanh.ncp.toggleDlModelGroupingGroup downloadable models by capability.
chanh.ncp.toggleHotModelsShow only hot downloadable models.
chanh.ncp.filterCapGroupFilter a capability group by sub-capability.
chanh.ncp.clearCapFilterClear a capability filter.
10

Demo and mockup #

Supplementary material for evaluating the UI. Neither asset is required for the extension.

UI walkthrough

A 1:16 narrated tour of the server tree, Model Info, @chanh chat with slash commands, and agent mode with a local model. The MP4 is intentionally not committed.

YouTube The full walkthrough is live on YouTube — watch it here.
Preview of the interactive Chanh UI mockup Interactive · simulated

UI mockup

A self-contained browser mockup of the extension. It uses simulated models and downloads and does not connect to Lemonade.

Open the mockup
11

Development #

Extension

bash
npm install
npm run watch
# press F5 → Extension Development Host

npm run check-types runs the TypeScript compiler, npm run lint runs ESLint, and npm run package type-checks, lints and builds. npm run vsce-package packages a VSIX.

Website

bash
python -m http.server 8000 --directory website

The site is static. The GitHub Actions workflow publishes the website/ directory to Pages; Pages must be enabled with Source: GitHub Actions.

Repository layout

src/
├─ extension.ts          activation and command wiring
├─ serverManager.ts      server modes, health and lifecycle
├─ lemonadeClient.ts     HTTP client and wire types
├─ modelManager.ts       download, load, context, backend
├─ serverTreeview.ts     sidebar tree and persistence
├─ lmcProvider.ts        native language-model provider
├─ chatParticipant.ts    @chanh and slash commands
├─ systemMonitor.ts      CPU / GPU / RAM sampling
└─ binaryManager.ts      managed lemond binary

website/
├─ index.html            this documentation page
├─ styles.css
├─ site.js
├─ demo/                 poster + notes (MP4 excluded)
└─ mockup/               interactive UI mockup
12

Audio lab #

Audio Lab (lanly-dev.audio-lab) is a companion VS Code extension that brings speech-to-text (STT) and text-to-speech (TTS) into the editor, powered by the same Lemonade Server that Chanh runs locally. Where Chanh downloads, hosts and manages the local models, Audio Lab consumes them: it transcribes audio files, generates subtitles (SRT/VTT), and turns text into spoken audio — all without leaving VS Code.

How it depends on Chanh's models

  • Local models via Chanh. Chanh downloads and loads the STT/TTS models (for example Whisper for transcription, Kokoro and MOSS for speech generation) and serves them through Lemonade Server. Audio Lab reads those same installed models.
  • Shared server endpoint. Audio Lab connects to the running Lemonade server (audio-lab.lemonadeServerUrl, default http://localhost:13305) — the server Chanh starts and manages in LEMONADE or LEMOND mode.
  • Model eligibility. Chanh's Installed Models tree exposes STT/TTS-capable models; Audio Lab surfaces them under its STT / Subgen and TTS groups, so you pick a Whisper model to transcribe or a Kokoro/MOSS model to speak.

What you can do with it

  • Transcribe audio files (MP3, WAV, OGG, M4A, FLAC, AAC, WMA, WebM, Opus, AMR, AU, AIFF) straight from the Media Files tree view.
  • Generate SRT or VTT subtitles from audio, listed next to the source file.
  • Generate a speech audio file from text using TTS (Kokoro or MOSS models).
  • Clone a voice with MOSS: right-click an audio file and choose Set as Voice Reference.

Using them together

  1. Install Chanh and Audio Lab from the Marketplace.
  2. In Chanh, start Lemonade Server and download a transcription model (for example whisper-large-v3t) and a TTS model (for example kokoro-v1).
  3. Open the Audio Lab activity bar, pick your STT/TTS model, then transcribe an audio file or generate speech from text.
Default server URL

Audio Lab defaults to http://localhost:13305, Chanh's chanh.lemonadePort for the system-installed Lemonade Server. If you run the managed lemond binary instead, set audio-lab.lemonadeServerUrl to http://localhost:8000 (or your server's URL).

13

License #

Chanh is released under the MIT License. Model weights and third-party runtimes keep their own licenses.

Chanh is not affiliated with Microsoft. VS Code is a trademark of Microsoft Corporation.