A coding assistant generates program code from prompts or partial definitions. It can run remotely behind an API or locally on commodity hardware, where latency, memory, and model size shape usefulness. section 7.3
A practical local deployment involves:
- Selecting a domain-specific model such as StarCoder v2 3B. section 7.3
- Using GGUF quantization to reduce hardware requirements. section 7.3
- Running inference through llama.cpp rather than relying on Transformers for direct GGUF execution. section 7.3
- Measuring latency and throughput against the target laptop. section 7.3
Local completion
Prompting a quantized StarCoder v2 3B model with `def hello_world():` produces a Python completion such as a return statement. A 4-bit GGUF configuration is benchmarked at roughly 433 ms average latency and 2.31 completions per second. section 7.3
llm = Llama(
model_path=model_path,
n_ctx=3072,
n_threads=4
n_gpu_layers=0
)
The llama.cpp configuration exposes the operational controls for local inference: context length, CPU threads, and GPU-layer allocation. section 7.3
