IDE Integration
EdgeCoder provides two ways to write code with AI assistance: the EdgeCoder Desktop App (the primary, built-in experience) and external IDE integration through an OpenAI-compatible endpoint that works with VS Code, Cursor, Zed, JetBrains, Windsurf, and any other editor that supports custom OpenAI providers.
EdgeCoder Desktop App (Primary)
The desktop application is a Tauri + Svelte app that ships as the primary development surface for EdgeCoder. It connects directly to all local services on ports 4301 through 4304 and provides a fully integrated IDE experience without any external configuration.
Chat-first interface
The default tab is ChatView -- a conversational interface with streaming responses and full conversation history. Conversations are persisted in IndexedDB, so your history survives restarts.
Code blocks in chat responses include "Open in Editor" buttons that send the snippet directly into the built-in editor.
Built-in Monaco editor
The EditorView tab embeds a Monaco editor (the same engine behind VS Code) with:
- An integrated chat panel for inline code assistance
- A file explorer for navigating your project
- Syntax highlighting for all common languages
You can work entirely within the desktop app -- ask questions in chat, open generated code in the editor, and iterate without switching windows.
Additional pages
Beyond Chat and Editor, the desktop app includes:
| Page | Purpose |
|---|---|
| Dashboard | Node status, task metrics, mesh health |
| ModelManager | Install, remove, and configure Ollama models |
| MeshTopology | Visual map of connected mesh peers |
| TaskQueue | View and manage queued, running, and completed tasks |
| Credits | Credit balance and transaction history |
| ActiveWork | Currently executing tasks and progress |
| Settings | Configuration for services, models, and network |
| LogViewer | Streaming logs from all services |
| Account | User profile, wallet, passkeys |
Storage
- IndexedDB for conversation persistence
- localStorage for user settings and UI state
Launching the desktop app
cd "/path/to/EdgeCoder"
npm run desktopThe app connects to the local services automatically. Make sure the backend services are running (see Runtime modes and the README quickstart for details).
External IDE Integration
If you prefer to work in your own editor, EdgeCoder exposes an OpenAI-compatible endpoint on port 4304. Any IDE or tool that can talk to the OpenAI API can use EdgeCoder as a backend -- no plugin or extension required, just a base URL.
How it works
Your IDE --> POST /v1/chat/completions
|
v
EdgeCoder Provider Server :4304
|
v
IntelligentRouter waterfall
+------------+-------------+
v v v
BT-local ollama-local swarm
(free) (free) (credits)The provider server at :4304 accepts standard OpenAI chat/completions requests and routes them through IntelligentRouter automatically:
| Priority | Route | Cost | When |
|---|---|---|---|
| 1 | Bluetooth-local | Free | iPhone in BT Local mode + connected |
| 2 | Ollama-local | Free | Local Ollama healthy, <2 concurrent, p95 <8s |
| 3 | Swarm | Credits | Mesh token set, local overloaded or slow |
| 4 | Edgecoder-local | Free | Always-on stub safety net |
Available model IDs
When adding EdgeCoder in your IDE, you can choose which routing mode to use by picking a model name:
| Model ID | Behaviour |
|---|---|
edgecoder-auto | IntelligentRouter picks the best route automatically (recommended) |
edgecoder-local | Force local Ollama only -- never touches swarm |
edgecoder-swarm | Force swarm network -- costs credits |
Step 1 -- Start the provider server
Open a terminal in the EdgeCoder project root:
cd "/path/to/EdgeCoder"
npm run dev:ideKeep this running. You should see:
{"level":"info","msg":"Server listening at http://127.0.0.1:4304"}Security: token, bind address and shell approval
The provider server can read and write your project and run commands, so it is locked down by default (#4).
- Bind address. It binds to
127.0.0.1only. SetIDE_PROVIDER_HOSTto change this. A non-loopback host is refused unlessIDE_PROVIDER_TOKENis set explicitly. - Bearer token. Every route except
GET /healthneedsAuthorization: Bearer <token>.- The token comes from
IDE_PROVIDER_TOKEN, or from~/.edgecoder/ide-token. - If neither exists, the server creates the file on first start (mode 0600, 32 random bytes, base64url).
- The VS Code extension reads the file automatically, or uses the
edgecoder.providerTokensetting.
- The token comes from
- Browser and DNS-rebinding protection. Requests carrying a web
Origin(http(s)://…) get 403. When the server is bound to loopback, so do requests whoseHostis not127.0.0.1:4304,localhost:4304or[::1]:4304.- The desktop webview origins (
tauri://localhost,http(s)://tauri.localhost) are allowed. - Add more origins with
IDE_ALLOWED_ORIGINS(comma-separated). - Desktop in Vite dev mode runs at
http://localhost:1420, so start the IDE server withIDE_ALLOWED_ORIGINS=http://localhost:1420 npm run dev:ide. - The desktop app reads
~/.edgecoder/ide-tokenthrough the Tauri commandget_ide_token, so the token file is the single source of truth.
- The desktop webview origins (
run_shell. Every shell command needs your approval in the IDE.- Commands are parsed into argv and run with
shell: false, with variables like*_TOKEN,*_SECRET,*_PASSWORD,*_API_KEYand*_PRIVATE_KEYstripped from the environment. - Shell syntax (
;,&&,|, backticks,$(, redirects) is refused unless approved. - Commands get an allowlisted environment only:
PATH,HOME,USER,SHELL, locale, terminal and temp variables, andLC_*. Add names withIDE_SHELL_ENV_PASS(comma-separated). Everything else, including every token and secret, is dropped. - Without approval, the following are refused:
node/pythonwith inline-code flags (-e,-c,-p,-m,--eval, …) or with no arguments (REPL)npx,npm exec,cargo runandgo run- binaries given as a path
- any path argument outside the project root (absolute,
~or..) gitsubcommands that modify anything
- Warning:
IDE_SHELL_AUTO_APPROVE=1still lets the model run allowlisted tools such asnpm testornode script.js, and those run project code as you. Only enable it for projects you trust. IDE_SHELL_AUTO_APPROVE=1(local opt-in) skips the prompt only for allowlisted binaries. The default allowlist isnpm,npx,node,python3,pytest,git(read-only subcommands),ls,cat,rgand similar. Override it withIDE_SHELL_ALLOW(comma-separated).
- Commands are parsed into argv and run with
Extension endpoints
The VS Code extension uses these endpoints (#36). The full contract is in src/apps/ide/routes.ts.
GET /health(no token)GET /status(alias of/v1/router/status)POST /run,POST /run/localandPOST /run/swarmwith{ task, language, maxTokens? }
/run/swarm returns 503 { "error": "swarm_unavailable" } when MESH_AUTH_TOKEN is not set.
Step 2 -- Add as a custom model in your IDE
Cursor
- Open Cursor Settings (
Cmd+,) - Go to Models
- Under the OpenAI section, enable "Override OpenAI Base URL"
- Set the base URL to:
http://127.0.0.1:4304/v1 - Set the API key to your IDE token (
cat ~/.edgecoder/ide-token). It is sent asAuthorization: Bearer <token>and is required. - In the model name field, type
edgecoder-autoand press Enter to add it - Select
edgecoder-autoas your active model
Cursor calls
POST /v1/chat/completions-- EdgeCoder handles it natively.
Zed
Add to ~/.config/zed/settings.json:
{
"language_models": {
"openai": {
"api_url": "http://127.0.0.1:4304/v1",
"available_models": [
{
"name": "edgecoder-auto",
"display_name": "EdgeCoder (auto-route)",
"max_tokens": 8192
},
{
"name": "edgecoder-local",
"display_name": "EdgeCoder (local only)",
"max_tokens": 8192
}
],
"version": "1"
}
},
"agent": {
"default_model": {
"provider": "openai",
"model": "edgecoder-auto"
}
}
}Or use the UI: Agent Panel -> settings icon -> Add Provider -> OpenAI-compatible -> paste the URL.
Continue.dev (VS Code / JetBrains plugin)
Add to ~/.continue/config.json:
{
"models": [
{
"title": "EdgeCoder (auto-route)",
"provider": "openai",
"model": "edgecoder-auto",
"apiKey": "<contents of ~/.edgecoder/ide-token>",
"apiBase": "http://127.0.0.1:4304/v1"
},
{
"title": "EdgeCoder (local only)",
"provider": "openai",
"model": "edgecoder-local",
"apiKey": "<contents of ~/.edgecoder/ide-token>",
"apiBase": "http://127.0.0.1:4304/v1"
}
]
}Or use the in-app config: click the model selector in the Continue sidebar -> Add Model -> OpenAI-compatible -> fill in the URL and model name.
JetBrains (IntelliJ, PyCharm, WebStorm, etc.)
- Go to Settings -> Tools -> AI Assistant -> Models & API keys
- Click Add Model
- Select provider: OpenAI compatible
- Set the API endpoint URL to:
http://127.0.0.1:4304/v1 - Enter any API key (e.g.
edgecoder) - Enter model name:
edgecoder-auto - Click Test Connection -- should return model info
- Click Apply
Windsurf (Codeium)
Windsurf's primary AI is hosted. For custom models, use the MCP (Model Context Protocol) server support:
- Go to Settings -> Cascade -> MCP Servers
- Add an OpenAI-compatible MCP entry pointing to
http://127.0.0.1:4304/v1
Alternatively, install Continue.dev alongside Windsurf -- it works in any VS Code fork.
Claude Code (Anthropic CLI)
Claude Code is a terminal agent, not a visual editor, so it does not add custom models the same way. Instead, you can call the EdgeCoder provider directly from scripts or use it as a tool endpoint.
For agentic workflows, the REST API at :4304 is fully scriptable:
curl -s http://127.0.0.1:4304/v1/chat/completions \
-H "Authorization: Bearer $(cat ~/.edgecoder/ide-token)" \
-H "Content-Type: application/json" \
-d '{
"model": "edgecoder-auto",
"messages": [{"role": "user", "content": "Write a Python function to debounce a callback"}]
}' | jq '.choices[0].message.content'Verifying the connection
Test that the server is up and returning models:
# Health check
curl http://127.0.0.1:4304/health
# Model list (OpenAI format)
curl -H "Authorization: Bearer $(cat ~/.edgecoder/ide-token)" http://127.0.0.1:4304/v1/models | jq '.data[].id'
# Quick inference test
curl -s http://127.0.0.1:4304/v1/chat/completions \
-H "Authorization: Bearer $(cat ~/.edgecoder/ide-token)" \
-H "Content-Type: application/json" \
-d '{"model":"edgecoder-auto","messages":[{"role":"user","content":"say hello"}]}' \
| jq '.choices[0].message.content, .edgecoder'The response includes an edgecoder field with route and latencyMs so you can see which backend handled the request.
System-aware chat
All chat requests (both portal and IDE provider) receive a server-injected system prompt that makes the chatbot aware of its own model, installed models, swarm state, routing behavior, and download progress. You can ask "What model are you running?" or "What models are on the network?" and get accurate, real-time answers.
For the IDE provider path, any file-context system messages sent by the editor (e.g. "The user is editing main.py") are preserved and merged after the EdgeCoder system prompt. See the Model Management guide for details.
Download progress
When a model download is in progress, the desktop app displays a slim progress banner in both the Chat and Editor panels. The banner shows the model name, a progress bar, and percentage. You can also query the progress programmatically:
curl http://127.0.0.1:4301/model/pull/progressRouting behaviour
When does traffic go to swarm?
The router spills to swarm when local Ollama is overloaded (>2 concurrent), too slow (p95 >8s), or unhealthy. Swarm tasks cost credits from your agent account; the fulfilling agent earns them.
When does Bluetooth-local activate?
When your iPhone is running EdgeCoder with Bluetooth Local mode enabled and is connected to your Mac over BT. The inference runs on the phone's llama.cpp model -- free, offline, no credits involved.
Forcing a specific route
Pick the model ID:
| Want | Model ID |
|---|---|
| Always local | edgecoder-local |
| Always swarm | edgecoder-swarm |
| Smart routing | edgecoder-auto |
Troubleshooting
IDE says "connection refused" or "API error"
The provider server is not running. Start it:
cd "/path/to/EdgeCoder" && npm run dev:ideIDE says "model not found"
Make sure you typed the model name exactly: edgecoder-auto, edgecoder-local, or edgecoder-swarm. Verify they appear:
curl -H "Authorization: Bearer $(cat ~/.edgecoder/ide-token)" http://127.0.0.1:4304/v1/modelsResponses are slow
Check which route was used -- look at the X-EdgeCoder-Route response header or the edgecoder.route field in the JSON. If it is hitting swarm, the local model may be overloaded or unhealthy. Verify Ollama is running:
curl http://127.0.0.1:11434/api/tagsCursor keeps asking for an OpenAI API key
Enter your IDE token (~/.edgecoder/ide-token) in the API key field. The server rejects requests without it (401).
Desktop app cannot connect to services
Make sure the backend services are running. The desktop app expects the coordinator on port 4301, inference on 4302, control plane on 4303, and the IDE provider on 4304. Start all services:
cd "/path/to/EdgeCoder" && npm run dev