Local-first AI development with Veryfront Code and LM Studio


Table of Contents
Overview
Run a Veryfront Code agent with a local model through LM Studio, keeping inference on your machine while preserving the same project structure you can use with hosted models later.


- Veryfront Code — Holds the application, agent, tools, and knowledge, and calls the local API.
- LM Studio — Runs locally and exposes an OpenAI-compatible API for local inference.
- Ministral 3 3B — The LLM that generates the agent's responses on your machine.
Start LM Studio
You need Node.js 22.3 or later and LM Studio. This guide uses its headless daemon. Install it with:
The installer also provides the lms CLI. Start the daemon, download the model,
and start the inference server:
The final command should report:
The server is now available only to applications on your machine.
Create a Veryfront app
Scaffold your project using the ai-agent template:
The scaffold creates the following files:
Create .env.local in the project root and define the following environment
variables:
The local LM Studio server does not require a token by default, but the
OpenAI-compatible provider expects a non-empty value. Veryfront also blocks
loopback provider requests unless the exact origin is allowlisted. Keep this
allowlist scoped to 127.0.0.1:1234 and use it only with trusted project code.
Update agents/assistant.ts:
Start the app
Start the Veryfront development server:
Use the app
Open http://localhost:3000.
Select the suggestion or send the same message yourself:
The agent calls the tool and responds using the model running on your machine.

Evaluate the agent using LLM-as-Judge
Update evals/assistant.eval.ts and configure the LLM-as-Judge to use the
openai/mistral-local model:
Both the agent and LLM-as-Judge use the model served by LM Studio, so all model inference during the evaluation stays on your machine.
Run the eval:
The evaluation passes all three gates:
Know the privacy boundary
Local model inference keeps the model request on your machine, but that does not automatically make every part of an application local.
Tools can call external APIs. Applications can use remote databases. Logging and observability can send data to external services.
When privacy matters, inspect the complete path that data takes through the application. LM Studio gives you control over one important part of that path: model inference.
Keep the inference layer replaceable
Veryfront gives you the flexibility to choose where model inference runs, independently of where the application is developed or deployed. The same project can use different inference options:
- A local model running on your machine with LM Studio, Ollama, or directly inside the application.
- A self-hosted model running in your own infrastructure.
- A managed model accessed directly from a provider or through Veryfront Cloud.
The model binding and provider configuration change; the agent, tools, UI, and evals stay in the same project.

