On this page
A local coding assistant is useful when you want to experiment without sending every prompt to a hosted service. It can explain unfamiliar functions, suggest tests, and draft small refactors. It is not automatically private, accurate, or faster simply because the model runs on your laptop.
Ollama and LM Studio offer different ways to download and serve models locally. Treat the first installation as an engineering evaluation: choose a bounded workload, inspect the data path, and measure whether the output survives your normal review process.
Choose a workload before choosing a model
Start with bounded coding tasks rather than asking a model to understand an entire repository. Good candidates include explaining a pure function, drafting fixtures from a documented schema, and proposing edge cases for an existing validator. These tasks have small inputs and relatively clear success criteria.
Create a ten-task evaluation pack from work you already understand. Include one deliberately ambiguous request and one task whose correct answer is to ask for more information. Save expected behaviours separately so they do not leak into the prompt. A convincing explanation should not count as success when the patch fails its tests.
Use the AI coding assistants directory to compare editor integrations, but check each integration's actual endpoint configuration. Some extensions support a local completion endpoint while continuing to send chat, embeddings, or telemetry elsewhere. Local inference describes one component, not the whole system.
Record what you want to improve: fewer context switches, offline availability, or control over source disclosure. If the model generates code quickly but requires repeated corrections, it may still be unsuitable for your chosen workload.
Match the runtime to your machine
Ollama's documentation covers its command-line workflow and local API. LM Studio's documentation explains its desktop model management and serving options. Choose the interface that makes model selection, loading, and endpoint inspection easiest for your team rather than assuming one is universally better.
Memory needs depend on model size, quantisation, context length, and runtime overhead. Quantisation reduces the precision used to store model weights, often lowering memory consumption, but its quality and speed trade-offs depend on the model and hardware. Download size alone is not a reliable estimate of total memory use.
Start with a modest coding-oriented model that your machine can load comfortably. Check its licence, supported runtime format, and intended use. Leave room for the editor, browser, development server, and operating system. A setup that works only when every other application is closed is not a realistic development environment.
Measure the first response delay separately from generation speed. Model loading can dominate the first request, while longer conversations may slow subsequent requests. Run the same task after a cold start and after several exchanges. Note power use and thermal throttling if developers work on laptops.
Connect the editor without exposing the server
Keep the inference service bound to a loopback interface unless you have a deliberate, secured network deployment. Do not forward its port through a router or expose it through a development tunnel for convenience. An endpoint that accepts prompts may also expose expensive capabilities or sensitive conversation content.
Follow the runtime's documented authentication and networking behaviour rather than assuming an OpenAI-compatible endpoint inherits a hosted provider's protections. Protocol compatibility means request shapes may match; it does not mean authentication, tool calling, streaming, or every parameter behaves identically.
A typical Ollama request can make the expected data flow visible before adding an editor extension:
curl http://localhost:11434/api/generate -H 'Content-Type: application/json' -d '{"model":"YOUR_INSTALLED_MODEL","prompt":"Explain why an empty array needs a test case.","stream":false}'Replace the placeholder with an installed model name. Use an innocuous prompt first, then inspect extension settings and logs for the endpoint actually contacted. Disable unnecessary indexing until you understand what files it reads and where any embeddings are generated.
Local operation still leaves artefacts: model caches, conversation histories, editor logs, and backups. Apply your organisation's rules for secrets and customer data. A private workstation is not permission to paste production credentials into a chat window.
Supply narrow context and explicit constraints
Local models often benefit from small, relevant context rather than indiscriminate repository dumps. Supply the target function, its immediate types, a failing test, and the required behaviour. State which files may change and whether public interfaces must remain stable.
Ask for a plan before a patch when the task crosses module boundaries. Review the proposed assumptions, then request one change at a time. If the model invents a dependency or API, provide the relevant documentation excerpt rather than repeatedly asking it to try harder.
A useful prompt says: “Propose two tests for this parser. Preserve the current return type. Explain the expected result for each test before writing code. Ask if invalid input behaviour is unspecified.” This creates an observable contract against which you can judge the answer.
For a generated validation expression, use the regex tester to try representative matches and non-matches before integrating it. Confirm behaviour again in the application's actual regex engine; a browser-based result does not establish compatibility with every backend language.
Keep accepted prompts and failures in a lightweight evaluation log. The broader AI hub can help you compare workflows, but your repository's constraints should determine the model's role.
Evaluate correctness, cost, and maintenance
Treat every generated diff as untrusted code. Run existing tests, add missing edge cases, inspect dependencies, and review security-sensitive paths manually. The OWASP secure coding practices provide a useful checklist for concerns that a plausible patch can overlook.
For each evaluation task, record completion time including prompting, waiting, reviewing, and repairing. Also record failures that you abandoned. Excluding unsuccessful attempts makes a weak assistant appear more productive than it is. Compare against your normal approach on similar tasks, not an imagined perfect manual implementation.
Watch for context drift during longer sessions. A model may gradually forget an earlier constraint or reuse an obsolete function signature. Restart with a compact, verified brief rather than accumulating corrections indefinitely. Keep architectural decisions in repository documentation, not only in conversational memory.
Pin the runtime and model identifiers used for a team trial, then rerun the evaluation pack when either changes. Models, templates, and integrations can alter results independently. Choose a fallback workflow for tasks the local setup cannot handle, including simply working without AI. Local tooling should reduce dependency risk, not create a new single point of failure.
Key takeaways
- Start with bounded tasks and an evaluation pack you can verify.
- Budget memory for the whole development environment, not just model weights.
- Inspect endpoints, networking, logs, and indexing before sharing source.
- Give narrow context and review generated code through normal quality gates.
- Measure review and repair time alongside generation speed.
Reach designers & developers at work
Put your product next to the tools people use every day. One sponsor per placement, no tracking pixels.
Become a sponsor