Local LLMs (Experimental)
SmartCursorX supports running quantized GGUF models locally using a bundled llama-server binary. This enables fully offline AI inference with no API costs and no data leaving your machine.
Quick Start
- Open Settings → Local LLMs (Exp)
- Search for a GGUF model on HuggingFace
- Click Browse files on a model repo
- Click Download on a GGUF file
- Click Run next to the downloaded model
- Chat using the
localprovider
Model Search
The built-in HuggingFace search lets you find GGUF models:
- Searches
huggingface.co/api/modelswith?tags=gguffilter - Returns up to 15 results sorted by downloads
- Shows model ID, description, and download count
- Click Browse files to see available GGUF variants in a repo
HuggingFace Token (Experimental)
Some models (Llama, Mistral, etc.) are gated and require authentication:
- Get a token at huggingface.co/settings/tokens
- Enter it in the HuggingFace Token (Exp) field in the Search section
- Token is stored securely via
secureStore - Automatically passed as
Authorization: Bearerheader on download
Downloading Models
- Downloads are streamed with progress display
- Files are saved to
%APPDATA%\smart-cursor-x\models\ - Partial downloads are NOT automatically cleaned up on failure
- Downloaded models show a green Downloaded badge in search results
Server Setup
The bundled llama-server binary powers local inference:
Binary Location
The download script (download-llama-server.ps1) installs to:
%APPDATA%\smart-cursor-x\bin\llama-srv.exe
The server searches in this order:
%APPDATA%\smart-cursor-x\bin\llama-srv.exe%APPDATA%\smart-cursor-x\bin\llama-server.exeresources\llama-srv.exe(packaged app)resources\llama-server.exe(packaged app)
Server Parameters
When started, the server runs with:
- Host:
127.0.0.1(localhost only — no external access) - Port:
8080 - GPU layers:
0(CPU only by default) - Context:
2048tokens
Starting & Stopping
- Click Run next to a downloaded model — button shows "Starting..." immediately
- Server status is displayed with green indicator
- Click Stop to shut down the server
- Server auto-stops on app quit (via
will-quithandler)
Provider
The local provider routes chat requests to http://localhost:8080/v1/chat/completions (OpenAI-compatible format):
- No API key required
- Model list auto-populates from downloaded GGUF files
- Zero cost for cost estimation
Architecture
User Chat → AIService.createLanguageModel('local')
→ createOpenAICompatible({ baseURL: 'http://localhost:8080/v1' })
→ llama-server on 127.0.0.1:8080
→ GGUF model file
Troubleshooting
Antivirus False Positives
Norton and Windows Defender may flag llama-server.exe as IDP.Generic. The binary is renamed to llama-srv.exe to minimize this, but exclusions may still be needed.
Missing Binary
If findLlamaServer() returns null, the server binary may be missing or quarantined. Run npm run fetch:llama or check antivirus quarantine.
Server Won't Start
- Process exits immediately: Missing DLLs or corrupted binary — re-download
- Port in use: Another service on port 8080 — stop the conflicting service
- Access denied: Antivirus blocking — add exclusion
Chat Fails with ECONNREFUSED
The server isn't running or crashed. Check if the green "Server Active" indicator is visible. If not, click Run next to your model.