liveBook · Manning

Chapter 12: Running on your laptop

What you will learn in chapter 12 of Domain-Specific Small Language Models

Introduces the chapter’s focus on running personal SLM-based assistants directly on a laptop, including offline use.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces the chapter’s focus on running personal SLM-based assistants directly on a laptop, including offline use.

12.1 Why use a personal local assistant

Explains why privacy and safety concerns motivate using a personal assistant that runs locally rather than relying on commercial online LLM services.

Key terms: commercial LLMs, chat interface, API, opt out, privacy and safety concerns, open source small language models, personal local assistant, user’s laptop, RAG applications

12.2 Running an LLM locally with Ollama

This section shows how to run quantized models locally with Ollama, access them through its CLI or API, and chat through a LocalLLM web frontend.

Key terms: Ollama, Modelfile, run, CLI chat, quantized, CPU, RAM, list, rm, REST API

12.2.1 Importing a custom model into Ollama

This section shows how to convert a custom model to GGUF, configure it with a Modelfile, and import it into a running Ollama server for chat.

Key terms: llama.cpp, GGUF, convert_hf_to_gguf.py, Modelfile, ollama CLI, FROM, TEMPLATE, PARAMETER, context length, stop words

12.2.2 User privacy in Ollama

Explains what Ollama’s local operation does and does not imply for user privacy, including update traffic and unencrypted local files.

Key terms: local-model inference, packet sniffing, Ollama, update check, IsNewReleaseAvailable, updater.go, lifecycle.go, history file, server log file, prompt text

12.3 Running an LLM locally with LM Studio

This section shows how LM Studio runs local models for chat and API use, and explains how its speculative decoding feature can speed up generation.

Key terms: GGUF, Apple MLX, chat view, context window, retrieval-augmented generation (RAG), lms CLI, API server, REST API, developer view, server log stream

12.4 The LM Studio Python SDK

This section shows how to use the LM Studio Python SDK for local model interactions, including chat, text completion, embeddings, and multi-round tool calling.

Key terms: LM Studio Python SDK, convenience API, scoped resource API, respond, PredictionResult, content, respond_stream, Chat helper class, system prompt, complete

12.5 Running an LLM locally with Jan

This section explains how to chat with local models in Jan, import compatible models, and serve them to local applications through an API.

Key terms: Jan, desktop app, local models, chat view, Jan Hub, Hugging Face Hub, GGUF, Import Model, My Models, multimodal models

12.6 The Cortex local LLM engine

This section describes Cortex as Jan’s local LLM engine, shows the basic steps for running a model with it, and explains the privacy appeal of local assistant tools.

Key terms: Cortex, Jan, llama.cpp, ONNX Runtime, quantization modes, cortex CLI, server, Jan catalog, pull, chat session

12.7 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 11: Deployment and serving Chapter 13: Creating end-to-end LLM applications →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.