liveBook · Manning

Chapter 12: Comparing and selecting LLM models

What you will learn in chapter 12 of Build Applications with Local AI Models on a Mac

Introduces the challenge of choosing among Ollama models and gives a way to check current model availability before selecting one.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces the challenge of choosing among Ollama models and gives a way to check current model availability before selecting one.

Key terms: ollama list, ollama pull <model>, Ollama model library, tags

12.1 Model families and their strengths

Introduces open-weight LLMs as downloadable model families with differing approaches and strengths.

Key terms: open-weight, model weights, model families, Llama, Gemma, Qwen

12.1.1 Llama (Meta)

Introduces Meta’s open-weight Llama family, its development over time, and why it is a practical starting model.

Key terms: Llama, open-weight, fine-tuning, Llama 2, Llama 3, Llama 3.2, Llama 4, MoE, multimodal, general-purpose tasks

12.1.2 Gemma (Google)

This section outlines Gemma’s major releases and explains why its efficiency makes a small Gemma-family model suitable for the book’s main path.

Key terms: Gemma, 9B Gemma 2, efficiency, modest hardware, Gemma 1, Gemma 2, Gemma 3, Gemma 4, multimodal, context

12.1.3 Qwen (Alibaba Cloud)

This section identifies Qwen’s multilingual strength and explains how to read the active-parameter counts in its MoE model names.

Key terms: Qwen, multilingual strength, Asian languages, coding, mathematical reasoning, MoE, A3B, A22B, active for each token

12.1.4 Mistral (Mistral AI)

Introduces Mistral’s notable Mixtral architecture and the strengths that distinguish the model family.

Key terms: Mistral, European languages, reasoning, structured thinking, Mixtral 8x7B, mixture-of-experts (MoE), parameters, token

12.1.5 DeepSeek (DeepSeek AI)

Introduces DeepSeek through two models with different defining characteristics.

Key terms: DeepSeek-V3, DeepSeek-R1, MoE, active parameters, reasoning model, MIT license

12.1.6 The model ecosystem

This subsection shows that five open-weight model families reach the reader’s laptop through Ollama, making it easy to switch among them.

Key terms: model families, Ollama, local machine

12.2 Model size vs. quality tradeoffs

Explains what model size means and the general tradeoff between quality, speed, and memory use.

Key terms: B, parameters, inference, memory requirements

12.2.1 Model comparison quick reference

This section uses a model-size comparison to show why available RAM limits practical local LLM choices.

Key terms: RAM, disk swap, 14B model

12.2.2 Understanding tokens per second

This section explains what tokens are, how token-processing speed feels to a user, and which model sizes suit Macs with 8 GB or 16 GB of RAM.

Key terms: token, tokenization, tokens/sec, RAM, 2B to 3B models, 7B or 8B models, mixture of experts, MoE

12.2.3 Benchmarks: What they tell you (and what they don’t)

This subsection explains what LLM benchmarks measure and why testing a model on your own use case matters more than relying on scores alone.

Key terms: benchmarks, standardized tests, use case

12.2.4 The RAM reality check

This section shows how to check whether a local LLM will fit in available RAM and why choosing one that is too large can make it impractically slow.

Key terms: RAM, operating system’s monitoring tool, model’s file size on disk, RAM needs, rule of thumb, disk swap space, response generation

12.3 Multilingual capabilities

This section explains why LLMs differ in how well they handle different languages.

Key terms: multilingual capabilities, training data

12.3.1 Language strengths by model family

Compares model families’ language strengths and explains why multilingual performance varies.

Key terms: training data, model size, task, Qwen 2.5, Llama 3.1/3.2, Gemma 2, Mistral, Japanese, European languages

12.3.2 A side-by-side experiment

This subsection shows how to compare models’ responses to the same language prompt.

Key terms: same question, three models, phrasing, structure, level of detail, training data

12.3.3 Multilingual recommendation summary

The section gives starting model-family recommendations based on the language a reader needs.

Key terms: Qwen, Mistral, multilingual capability

12.4 Switching models in your chatbot

12.4.1 Step 1: Download the new model

Explains that pulling a model downloads it locally, where it remains until deleted, and that you can check which models are installed.

Key terms: pull, local machine, installed models

12.4.2 Step 2: Change one line of chat application code

This subsection shows how to switch the chatbot to a different AI model by editing one line in app.py.

Key terms: app.py, model name

12.4.3 Step 3: Add a Model Selector in the Streamlit UI

This subsection adds a sidebar dropdown to the existing Streamlit chatbot so users can compare installed local models without editing code.

Key terms: dropdown, sidebar, installed models

12.4.4 Managing your model collection

This subsection explains how to inspect and prune downloaded models so they do not occupy unnecessary disk space.

Key terms: installed models, sizes, disk space, download models, remove

12.4.5 A quick model comparison script

This section shows how to compare local models by asking them the same question and examining their responses side by side.

Key terms: test_models.py, model’s personality

12.5 The 2026 revolution: Frontier open models

Introduces three February 2026 model releases as a turning point for locally run AI, without explaining the models or their impact.

12.5.1 The mixture of experts revolution

Explains how mixture-of-experts models activate only selected subnetworks, giving them a different computation tradeoff from dense models.

Key terms: dense, mixture of experts (MoE), experts, router, cotraining, total parameters, active parameters, computation per token

12.5.2 Model 1: Zhipu GLM-5

This section describes GLM-5’s specifications and training approach, and explains how to interpret its reported benchmark results.

Key terms: open-weight MoE model, total parameters, active parameters, DeepSeek Sparse Attention, Humanity’s Last Exam, reasoning evaluations, benchmark results, slime, asynchronous data generation, training workers

12.5.3 Model 2: Alibaba Qwen3-Coder-Next

This section explains Qwen3-Coder-Next’s ultra-sparse design, its local memory requirements, and its reported coding-agent performance.

Key terms: Qwen3-Coder-Next, ultra-sparse MoE, parameters per token, dense model, q4_K_M, context, runtime overhead, available memory, coding agents, SWE-bench Verified

12.5.4 Model 3: MiniMax M2.5

This section presents MiniMax M2.5 as an open-source model with a coding benchmark score close to a leading proprietary model’s, at a substantially lower stated API price.

Key terms: MiniMax M2.5, SWE-bench Verified, Claude Opus 4.6, MiniMax’s own API, open source, own infrastructure

12.5.5 The February 2026 benchmark landscape

This subsection highlights how open models compared with proprietary models on demanding benchmarks in mid-February 2026.

Key terms: open models, proprietary models, benchmarks, real-world software engineering, research-level reasoning

12.5.6 The new model comparison table

This section explains why a frontier model can use far fewer parameters per token than its total size suggests and how to check whether a build will fit on a Mac.

Key terms: total parameters, active, compute per token, router, experts, RAM requirements, quantized build, context length, Ollama tag, unified memory

12.5.7 What this means for you

Explains why mixture-of-experts models can use computing power selectively and notes the emerging availability of quantized versions on Ollama.

Key terms: MoE architecture, knowledge, computing power, community-quantized, Ollama, Qwen3-Coder-Next, active-parameter count

12.6 Exercises

12.7 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 11: Managing session state and chat history Chapter 13: System prompts and parameter tuning →

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.