KoreaDevKNOWLEDGE SHARING

Content typeLearn

LLM EDUCATION · 04 / 8

Models and runtimes

Find and download the model, reproduce it with a compatible runtime, and record the source and version as evidence.

Difficulty
Foundations
Structure
3 core units · 15 chapters

CORE UNIT 1 / 3

Open-weight models by task

Fix task roles and quality criteria first, then approve open-weight candidates based on the official publisher's model card, revision, license, and artifact, runtime fit, and local evaluation evidence.

Difficulty
Practical
Structure
Lessons 5 · Labs 2 · Assessment

Diagrams and tables: composed by the author using each lesson's official primary sources. Find the originals and review dates at the end of that lesson.

NEW HIRE ONBOARDING

Start in the order you would receive your first assignment

So that even a new hire with no prior IT background can follow along, we start with the situation, the task, the evidence, and when to report, before difficult definitions.

  1. 01

    Read the situation in one sentence

    For Korean internal-policy Q&A, evaluate embedding document recall, reranker top ranks and generator evidence citations in separate tables.

  2. 02

    Today's assignment

    Fix task roles and quality criteria first, then approve open-weight candidates based on the official publisher's model card, revision, license, and artifact, runtime fit, and local evaluation evidence.

  3. 03

    Evidence that shows the work is complete

    Pin the input, output, sampling, and runtime conditions for the baseline and candidate, and repeat at least three times.

  4. 04

    When to stop and ask a senior colleague

    Fix the required language, modality, context, and format, and the boundaries for human verification, before searching for candidates.

Unpack unfamiliar terms first

Open-weight
A distribution form that provides access to model weights; code and data disclosure and usage rights must be confirmed separately in the license and policy
Model card
A document in which the creator describes intended use, structure and variants, evaluation and limitations, and terms of use
Provenance
Provenance lineage from the official source organization and revision through conversion and quantization to final deployment artifacts and hashes

PREREQUISITE CHECK

Three things to check before reading

This is not a test of memorized answers. Think about each question first, then open the explanation to review the foundational concepts used in this course.

1Are the model family name and the artifact actually deployed the same identifier?

No. A family name can cover multiple sizes, base/instruct variants and conversions. Identify the actual evaluated artifact through official organization/repository, exact revision, files and hashes, tokenizer/template and conversion recipe.

2If a model is open-weight, are source code, training data, and commercial use rights all open as well?

Not automatically. Weight access, the scope of code and data disclosure, commercial use, modification, redistribution, and prohibited conditions are separate items; review the license text and usage policy of the exact release.

3Can generation models, embeddings, and rerankers be compared with a single public benchmark score?

Different roles and outputs cannot be compared directly. Each needs its own gold set and metrics: correctness, evidence and format for generation; recall@k for embeddings; ranking quality and added latency for rerankers.

TEXTBOOK GUIDE

Main text that covers each concept from its background to the criteria for judging it

We explain the material section by section so readers new to IT can connect causes and effects without memorizing terms.

CONCEPT FLOW

How the chapters connect

The chapters are not isolated short answers to memorize. Follow them from left to right to see how each chapter's concepts support the next decision.

  1. 1.Separate roles and output contracts before choosing a model
  2. 2.Pin the revision and artifact provenance from the official publisher
  3. 3.Read variant·modality·context and limitations in the model card
  4. 4.Review open-weight status and license·usage policy as independent gates
  5. 5.Run a catalog with runtime fit, task evaluation, and rollback
Open-weight models by task: the overall map. If you lose track while reading the detailed explanations and chapters below, return to this sequence.

CONTROLLED EXPLANATION

Explore the order in which concepts build on each other

It does not start automatically. Play, or select the previous or next step, to see how the current concept connects to the next decision, step by step.

Current explanation · 1/5

Separate roles and output contracts before choosing a model

Chat generation, code, Vision and OCR, embedding, reranker, Speech-to-Text, and Text-to-Speech differ in inputs, outputs, and failure costs, so they cannot be chosen from a single ranking.

Split a task into stages such as generation, retrieval, reranking and speech, and define ground truth for each stage.

Up next: Pin the revision and artifact provenance from the official publisher, where this standard continues to apply.

See the full step description
  1. 1. Separate roles and output contracts before choosing a model

    Chat generation, code, Vision and OCR, embedding, reranker, Speech-to-Text, and Text-to-Speech differ in inputs, outputs, and failure costs, so they cannot be chosen from a single ranking. Split a task into stages such as generation, retrieval, reranking and speech, and define ground truth for each stage.

  2. 2. Pin the revision and artifact provenance from the official publisher

    A family name alone is insufficient for reproduction. Pin the official organization, exact repository and revision, files and hashes, and conversion and quantization lineage in one row. Trace community conversions to the original revision, conversion recipe, tools, and output hash.

  3. 3. Read variant·modality·context and limitations in the model card

    Treat base·instruct variants, sizes·architectures·modalities·context·languages, and usage restrictions within the same family as separate candidates so you do not compare the wrong artifacts. Distinguish parameter labels, actual file bytes, and total·activated parameters.

  4. 4. Review open-weight status and license·usage policy as independent gates

    Availability of weight downloads, disclosure of source code and training data, and commercial-use, redistribution, derivative-work, and usage restrictions involve different rights and obligations. Preserve the license file and acceptable use policy at the exact revision.

  5. 5. Run a catalog with runtime fit, task evaluation, and rollback

    Even candidates that pass the official card and license review are promoted to a deployment row only after passing role-specific quality, format, p95, memory, and failure-recovery checks on the exact hardware, runtime, and template. Pin the input, output, sampling, and runtime conditions for the baseline and candidate, and repeat at least three times.

The text description below shows the same content without the animation. Your operating system's reduced-motion setting is also respected.
Conceptual explanation 01

Decompose tasks into roles and output contracts, not model names

If you turn the request “Choose a Korean model that answers questions about internal documents well” directly into a model family search, the list of candidates grows without end. First write down the material users provide, the expected result, errors that cannot be tolerated, and the points where a person checks the output. Document Q&A chains together an embedding model that turns questions into vectors, a retriever that finds relevant documents, a reranker that reorders candidates, and a generative model that writes sentences based on the evidence. If tables are images, an OCR or Vision stage is added in front. These stages can run on different models and runtimes, and if you label a failure in one stage as a lack of overall LLM capability, you cannot find the cause.

Set an output contract for each role. For a generative model, what matters is correct answers·evidence citations·JSON format·holding when it does not know; for embedding, recall of the correct document within top-k; for a reranker, the rank of the correct document and added latency; for OCR, field·character·number accuracy; and for Speech-to-Text, word error rate and proper-noun accuracy. Merging them into a single “90% accuracy” column creates a false comparison of metrics whose denominators and failure meanings differ. Keep each role's metric formula, judge, and minimum sample size together in the catalog schema.

Create normal, boundary and failure examples before inspecting candidates. Generation includes unsupported questions, conflicting documents, dates, amounts and structured outputs as well as common questions. Retrieval includes short titles, long tables, synonyms and unanswerable questions. Vision includes blurry photos, rotation, small Korean text and merged table cells; speech includes background noise and internal abbreviations. Without a gold set reflecting real-user frequency and harm, only public benchmarks and demo impressions remain.

Text/image input or multilingual support does not automatically transfer a pass between roles. Image input does not guarantee numerical field accuracy on Korean receipts, and long context does not guarantee citing a clause on the final page. A small specialist reranker or OCR model may be more accurate and faster at its stage than a large generative model. Link the final system to each stage’s passing results, and ensure replacements can first be regression-tested on that role’s same workload.

Why does this happen?
This is because separating functions with different inputs, outputs, and error costs lets you find only the models you need and replace only the failed stage.
When is it a problem?
Choosing every capability from one popularity ranking can misdiagnose retrieval-recall deterioration as a generation-model problem, leaving errors even after purchasing a larger model.
Common beginner misconceptions
Multimodal or multilingual labels are not certification marks guaranteeing the same quality across every image·language·task.
How to verify it yourself
Draw your workflow as stages, and for each stage write one line each for input, output, gold answer, required metrics, and human approval points.
To summarize this sectionA good catalog is a decision tool linking each task stage to inputs, outputs, error costs and passing criteria, rather than a list of popular models.
Conceptual explanation 02

Identify the original by its official organization and exact revision

On the Hub, community uploads, merges, adapters, and conversions with names similar to the official creator's appear alongside the originals. Do not pick the original based only on download counts or names in search results. Cross-check that the organization and repository are the ones the creator's official site, GitHub repository, or model card points to. First confirm where release-specific model cards and licenses live, as in Meta's Llama model repository, and where variants of a model family are described, as in Google's official Gemma documentation. Treat a re-upload without an official link as a separate candidate of unknown origin.

A catalog identifier comprises organization/repository, exact commit revision, downloaded file names and bytes, and cryptographic hashes, not a display name. Branches and moving references such as `main` or `latest` may change after review, so pin the evaluation commit. Record the download date without using it as a substitute for revision. If the same model ID downloads to a different hash, compare changed files, cards, and terms instead of reusing prior approval unchanged.

Treat configuration, tokenizer, chat template, processor, and special-token files as one bundle with the weights. Mixing old tokenizers with new weights or another family’s role template with an instruct variant can change termination, system-role behavior, and quality. Compare rendered prompts and processor outputs immediately before model calls against official examples, and record each component’s source revision and hash in the manifest. An allowlist of files actually needed for deployment is easier to review than a note that the whole repository was copied.

To confirm reproducibility, another person must be able to download the same artifact again using only the catalog row. If there is an offline cache, record the relationship between the remote source and the local object hash, and for gated models that require access approval, record who downloaded them with which account and terms version. If the artifact cannot be downloaded again because a repository was deleted or permissions expired, keep the approved artifact in a permitted internal registry with retention and access policies. Even if the source disappears, you must be able to prove what was evaluated.

Why does this happen?
Uploads with the same name and moving tags can point to different files, so immutable identifiers are needed to reproduce the causes of results and the security state.
When is it a problem?
Recording only the repository name makes it impossible to tell whether the model, tokenizer, or template changed when quality shifts after an update.
Common beginner misconceptions
High download counts or an official family name in a community repository do not establish that it is the creator’s original source.
How to verify it yourself
Go from the official documentation to the repository, record the organization, commit, file list, bytes, and hashes, and download again in another environment to confirm the same hashes.
To summarize this sectionA family name is only a search term. Retrieving the same candidate again requires the official publisher, repository, commit revision, and file hashes.
Conceptual explanation 03

Read variants·architecture·context and limits in the model card

Even within the same family, base, pretrained, instruction-tuned, coding, safety, and vision variants differ in purpose and input format. A base model is the starting point of next-token training, while chat·instruct models may assume specific instruction tuning and templates. Do not interpret a name suffix by common sense; check the intended use, architecture, and example inputs defined by the creator. Also determine whether a repository card describes the whole family or the exact checkpoint, so you do not copy conditions from a different size.

Do not combine parameter count, artifact bytes, and runtime memory in one column. Dense and Mixture-of-Experts models can differ in total versus per-token activated parameters, and inclusion of vision encoders·embeddings in name counts varies. Check config layers·hidden size·attention structure and file lists, recording actual bytes by precision and load·prefill·decode peaks. Do not equate “30B-A3B” with a 3B file or 30B dense compute; connect official definitions to runtime logs.

Context windows and modalities are conditional architecture capabilities. Even within one family, official context or image-input support can vary by size, so read the exact variant card. A maximum context figure does not guarantee recall at every position, or concurrency, latency, and quality on your GPU. Ask for evidence at the beginning, middle, and end of minimal, representative, and longest documents to check truncation and lost-in-the-middle effects, and for Vision, also fix resolution, image count, and processor settings.

Do not push the limitations and risks section behind the performance tables. Map the training data overview, supported languages, factuality, bias, and safety, and unevaluated domains to your own usage conditions. If a card has no evidence for Korean or for domains such as medicine or law, do not assume support; record it as a gap requiring local evaluation and expert review. Reflect any "not recommended" or human-supervision conditions in app permissions and approval flows. An empty document is not a pass; it is unconfirmed.

Why does this happen?
Variants within a family differ in input, template, context, and evaluation scope, so you must know the exact checkpoint conditions to compare candidates correctly.
When is it a problem?
Copying the description of a different size or base variant can lead you to expect unsupported image or context capabilities, or ruin quality with the wrong template.
Common beginner misconceptions
The maximum context and public benchmark scores in a model card do not guarantee quality or speed for your languages·documents·hardware.
How to verify it yourself
Extract the variant, modality, context, language, and limitations from the exact checkpoint card and config, and link direct evidence or a gap to each row of your requirements.
To summarize this sectionA model card is starting evidence for comparing a candidate’s intended use, architecture·input conditions, evaluation scope, and known limitations against your requirements, not a recommendation slogan.
Conceptual explanation 04

Connect provenance from original sources through converted and quantized artifacts

Converting Hugging Face's original weights to GGUF for llama.cpp, MLX format, or a runtime-specific quantization produces a new artifact. If you record only a source model ID and save `model-q4.gguf`, there is no way to know which revision, quantization method, and tool version were used. The build manifest records source file hashes, converter and quantizer commits, the command and options, calibration data identifiers, and output file names, sizes, and hashes. Container images and build architecture also affect the result, so preserve the build as a rerunnable recipe where possible.

Community-made quantized files are convenient, but their provenance gap must be evaluated separately. Check whether the card includes the source revision and conversion command, whether the tokenizer and template match the original, and whether all split files are complete. The same Q4 label can differ in quality and kernel support depending on method, group, and mixed precision. Do not treat the quant label in a file name as a guarantee of performance or quality; read the actual metadata and conversion records.

Artifact security involves more than malicious code. Pickle-based files can execute code during deserialization, and custom modeling code or `trust_remote_code` executes repository code. Check Safetensors usage, required file-type allowlists, malware and secret scans, and dependencies. Fetch even official-organization files with least privilege in isolation and verify hashes. Check that the card viewed in the browser corresponds to the object received by the execution node.

Evaluation and rollback complete the lineage. Link each artifact’s role-specific evaluations and runtime and driver versions to failing inputs, logs, and the previous approved artifact’s hash. Put a smaller quantized candidate on hold if numerical extraction, Korean subset quality, or tool formatting regresses. Reconvert from the source or return to the previous artifact, and verify recovery of the same failing inputs before narrowing the cause to the quantization change.

Why does this happen?
Conversion and quantization change bytes, computation and errors, creating artifacts independent of the original that need quality, security and compatibility evidence.
When is it a problem?
Without a source revision and recipe, you cannot reproduce a quality regression in a smaller file or safely recreate it.
Common beginner misconceptions
Sharing a family and Q4 name does not make two models bit-for-bit identical regardless of who made them or how they were converted.
How to verify it yourself
Build a chain from the source hash through tool, command, and calibration to the output hash, and regenerate identical results in an isolated clean build.
To summarize this sectionDeployment files must be linked to the original revision, conversion tools and recipe, and output hash so same-named artifacts can be told apart and regression causes found.
Conceptual explanation 05

Separate open weights, source availability, and usage rights

Open-weight usually denotes the distribution fact that trained weights are accessible. This alone does not establish that training data, source code, and training recipes are all public or that a standard open-source software license applies. In the catalog, keep weight access, model license, code license, and data·recipe disclosure scope in separate columns. Replace the marketing phrase “open model” with concrete statements about which files can be obtained and what rights you have.

Read the exact release's license file and acceptable use policy. Check whether commercial use, redistribution, derivative works, attribution and notices, monthly-user or organization-size conditions, prohibited domains and geographic restrictions apply to your deployment. The Hub license metadata tag helps discovery but does not replace the original license and accompanying policies. Record the URL, file hash or revision, review date and reviewer, and refer important interpretation questions to your organization's legal review.

Adapter training, merging, quantization, and API delivery also raise different questions. Determine whether the obligations of the base model and the dataset and code licenses conflict, whether converted artifacts can be delivered to customers, and how to provide attribution, the card, and notices. Serving only through a server API without distributing files does not automatically remove prohibited-use, privacy, and output responsibilities. Do not cover the terms of use for an internal pilot and an external product under the same approval.

If the license is unclear, the candidate is on hold regardless of technical approval, even with high benchmarks. The person responsible must not fill blanks with a guessed "permitted"; instead, they record the questions to confirm, the advice needed, and alternative candidates. When the model release changes, review the diffs of terms and policies as well as weights. Reuse a previous version's review only where conditions are the same, and if new obligations arise, update deployment notices, access controls, and catalog status together.

Why does this happen?
Even a technically runnable model is not a lawful, sustainable candidate if its terms of use and redistribution do not fit the task.
When is it a problem?
Approving based only on a short license tag can mean discovering external distribution, derivative artifact, or usage-scale conditions too late and having to withdraw the product.
Common beginner misconceptions
Being able to download weights for free does not grant unrestricted commercial use or redistribution rights.
How to verify it yourself
Tabulate your use, modification, distribution, and prohibited terms from the exact revision's license and policy, and link the responsible reviewer's date and conclusion to the evidence.
To summarize this sectionWeight access, code and data disclosure, and commercial use and redistribution rights are separate, so review the original license text and usage policy for each exact release.
Conceptual explanation 06

Verify hardware, runtime, template and feature compatibility in one row

A compatibility row records model architecture and artifact format, hardware, operating system and architecture, driver, and runtime and backend versions together. A GGUF loading in llama.cpp does not mean the same file is supported in vLLM or MLX, and the existence of a Hugging Face repository does not guarantee a specific GPU quant kernel. Check the runtime's official supported-model and feature documentation and release notes, and pin the exact combination. Classify combinations missing from the support table as experimental rather than “probably works.”

Chat templates, tokenizers, and processors are part of functional compatibility. Compare the role and special tokens an instruct model expects, vision image processors, embedding pooling and normalization, and reranker input-pair formats against official examples. Test whether system roles, stop tokens, tool schemas, and structured output actually take effect, not merely whether a prompt produces output. Include deliberately invalid values and boundary inputs to detect wrappers silently ignoring unknown options.

Verify the actual execution path in startup logs and the profiler. Record whether every layer or operator runs on the intended GPU or NPU, the amount of CPU fallback and host-device transfer, and whether compiled graphs change as context and batch sizes increase. High utilization on one device does not prove acceleration of the entire graph. Break down latency and peak VRAM and RAM across loading, prefill, decode, embedding, and reranking to distinguish host tokenization, transfer, unsupported kernels, and queue bottlenecks.

Expand from a small passing baseline. Verify exact outputs with short text, concurrency 1 and default precision, then increase context, images, tools, batch and concurrency individually. On failure, revert the last change and check recovery of the same input rather than changing model, runtime, driver and template together. Catalog unsupported features, limitations, alternative paths and version-specific reproduced commands/logs as well as supported features.

Why does this happen?
This is because even the same artifact can run on a different device and differ in features·speed and results depending on the runtime·backend and template support.
When is it a problem?
Recording only load success misses problems in real operation, such as the tool format being ignored or p95 spiking because of CPU fallback.
Common beginner misconceptions
Architecture support in a model card does not automatically cover every quant, hardware, OS, and serving feature.
How to verify it yourself
Pin the exact stack in a manifest, check device placement and output on a short baseline, and then expand features and load one item at a time.
To summarize this sectionA model existing or loading once and the required features running correctly on the target device·runtime are separate gates.
Conceptual explanation 07

Evaluate quality and failure costs with role-specific gold sets

Evaluation sets must represent operational distributions and failure impact. For generative Q&A, define answers and supporting paragraphs from approved documents, with “no evidence” as the correct handling for unanswerable questions. Include numbers, dates, conflicting documents, long tables and prompt injection rather than favoring simple general-knowledge questions. Use compilation, tests and prohibited-API checks for coding, field-level ground truth for vision/OCR, and human-reviewed transcripts for speech. De-identify personal data through approved procedures.

Metrics reflect each role and the failures users experience. For generation, separate correctness, evidence fidelity, citation presence, schema compliance and safe refusals. For embeddings use recall@k; for rerankers use MRR, nDCG and added p95 latency. Do not let overall OCR character accuracy hide amount or account-field errors: require exact matches for critical fields. Likewise, give product-name and number subsets separate STT gates alongside average word error.

Compare the baseline and candidate under the same model input, prompt and template, output limit, sampling, evaluation code, and runtime conditions. Record any template differences the candidate requires, but keep the shared task inputs and judging criteria unchanged. Repeat at least three times to observe stochastic output and system variation, and if an automated judge is used, first validate its agreement with human gold labels and its biases. Do not lower the pass line after seeing results; preserve the predefined thresholds and change history.

Hold the candidate if an important subset fails, even when the overall average passes. Do not let 99% on general English questions conceal 70% on Korean number extraction. Preserve failing inputs, actual outputs, expected answers, judgment reasons and model/artifact hashes. Classify root causes as model, prompt/template, retrieval, quantization or runtime. After fixing one item, rerun the same failure set and the full regression suite to verify that the local improvement has not damaged other quality dimensions.

Why does this happen?
Task-specific errors and harms do not show up in public benchmark averages, so the actual usage distribution and important subsets must be the basis for approval.
When is it a problem?
Overall averages can let numerous easy cases hide severe regressions on essential cases such as missing evidence, numbers and Korean.
Common beginner misconceptions
A larger model or the top public ranking does not necessarily keep the same rank with your prompts, language, and quantization.
How to verify it yourself
Pin role-specific normal, boundary and failure gold sets and predefined thresholds, then compare baseline and candidate results including all failed rows.
To summarize this sectionUse public benchmarks to discover candidates. Decide promotion using normal, boundary, and failure sets from actual Korean tasks and role-specific metrics.
Conceptual explanation 08

Combine performance, memory, cost, and rollback into the deployment promotion gate

In the performance manifest, record the exact model revision and artifact, tokenizer and template, quant, runtime and driver, input and output tokens, sampling, batch and concurrency, and hardware power conditions. Separate cold download, load, and compile, warm Time To First Token, prefill and decode token/s, and end-to-end latency. Record p50, p95, maximum, and error rate instead of a single average, and repeat at least 3 times. If user requests mix short and long documents, include that ratio and the queue in the load.

Memory means peak usage at each stage, not file bytes. Record weights, KV cache or embedding batches, runtime workspace, host RAM·VRAM, and safety headroom. Gradually increase context·image count and concurrency to their targets to find OOM·fragmentation·swap. Even if lower-bit quantization reduces memory, unsupported kernels or quality loss may worsen p95·errors. Evaluate capacity, execution path, and quality in the same candidate row, with independent thresholds.

Cost includes not only hardware prices but also power, storage, network, operations staff, and downtime. Do not let a candidate that fails required quality, p95, memory, or availability survive on the overall score because it is cheap. Compare cost per request, headroom at the target load, and maintenance difficulty only among passing candidates. Prices and cloud rates change by date and region, so do not embed permanent rankings in the official catalog text; manage them as separate, dated outputs.

Actually run the canary and rollback before promotion. Keep the previous artifact, runtime, and config in an accessible registry, and send the same inputs that failed on the new candidate to the previous backend to confirm recovery. Record rollback time, cache and index compatibility, and the responsible owner in the runbook. After full cutover, keep monitoring quality, p95, errors, and drift; if a threshold is exceeded, do not automatically continue risky actions, and instead limit traffic or revert to the previous candidate.

Why does this happen?
Because a usable model must not only answer correctly but also respond stably under the target load and recover within a set time after a failure.
When is it a problem?
Looking only at one warm tokens/s result and file size leaves cold-start, p95 queue, maximum-context OOM and long-running failures undiscovered until deployment.
Common beginner misconceptions
The top-ranked candidate for quality does not automatically run fastest or at the lowest operating cost on the target hardware.
How to verify it yourself
Pass quality, p95, peak and error gates under repeated load with the same manifest, then measure recovery time for the same failing input using the previous artifact.
To summarize this sectionEven candidates that pass quality reach deployment-approved catalog status only after satisfying p95, memory, sustained-load and failure-recovery requirements for the same workload.
Conceptual explanation 09

Maintain the catalog as an operational registry with owners, validity periods, and re-review triggers

The catalog schema holds the role, official source and revision, artifact provenance, license conclusion, runtime stack, evaluation set version, quality, p95, and memory results, and owner. Divide status into evidence-based stages such as exploring, technical review, license hold, evaluation hold, canary, approved, and retired. Do not read blanks as passes; record evidence gaps that state which model card, license, runtime, or evaluation is missing. A single screen should show the current recommendation together with the conditions under which it is valid.

Each row needs a last review date and re-review triggers. Triggers include changes to the official repository·license, a new model revision, updates to conversion tools·runtime·driver, hardware replacement, prompt·retrieval changes, and drift in task data. Rather than failing a row automatically just because a date has passed, set the review interval according to how likely things are to change and the task risk. For high-impact events such as a security advisory or a license change, you must be able to put the related artifacts on hold immediately without waiting for the regular review.

When a new release comes out, do not overwrite the previous row. Create a new row or version for the new source revision and artifact hash, run the same gold set and load, and record the diff. Do not delete failed results or reasons for retirement either, so that the same candidate is not reviewed repeatedly and past decisions are not lost. When the evaluation set changes, do not rank old and new scores together directly; mark the dataset version and rubric change.

Final approval requires separated responsibilities. Technical reviewers assess provenance, runtime and measurements; task owners assess gold answers and failure costs; security and legal reviewers assess files, code and terms. Preserve an independent review check even if the approver also conducted the experiment, and do not treat browser checkboxes or screenshots alone as actual evidence. A catalog becomes an operational asset when another person can reproduce the conclusion from sources, manifests, raw results and rollback logs.

Why does this happen?
Because models, licenses, runtimes, and task data keep changing, recommendations go stale quickly without approval conditions, owners, and review dates.
When is it a problem?
Overwriting existing rows with the latest results makes it impossible to know which artifact was actually deployed and why it was retired, so regressions and audits cannot be handled.
Common beginner misconceptions
A model that passed once is not permanently approved for every new revision, runtime, and changed task.
How to verify it yourself
Pick one row and check whether a third party can follow its owner, source and artifact hashes, license, raw evaluation, approval conditions, triggers, and rollback evidence.
To summarize this sectionA recommendation list is not a document finished once but an evidence registry whose pass, hold, and retired statuses are updated as sources, licenses, runtimes, and tasks change.

CONCRETE CASES

Check concepts in different situations

Before memorizing definitions, compare how these concepts appear on a personal PC and in real work.

  1. Case 1 · Separate roles and output contracts before choosing a model

    For Korean internal-policy Q&A, evaluate embedding document recall, reranker top ranks and generator evidence citations in separate tables.

    Key points to check here: Split a task into stages such as generation, retrieval, reranking and speech, and define ground truth for each stage.
  2. Case 2 · Pin the revision and artifact provenance from the official publisher

    When comparing two GGUF files with the same name, you cannot explain performance differences without base revisions, tokenizers, quantization methods, and checksums.

    Key points to check here: Trace community conversions to the original revision, conversion recipe, tools, and output hash.
  3. Case 3 · Read variant·modality·context and limitations in the model card

    Conditions vary even within a family, as in Gemma 3's size-dependent context and modality differences. Compare the repository name with the exact variant in the model card.

    Key points to check here: Distinguish parameter labels, actual file bytes, and total·activated parameters.
  4. Case 4 · Review open-weight status and license·usage policy as independent gates

    Terms can change between releases even within the same family, so do not automatically copy a previous review result to a new revision.

    Key points to check here: Preserve the license file and acceptable use policy at the exact revision.
  5. Case 5 · Run a catalog with runtime fit, task evaluation, and rollback

    Even if the candidate’s average quality is the same, if Korean numeric extraction format and p95 fail, do not deploy it fully; fix the cause and retest the same failure set.

    Key points to check here: Pin the input, output, sampling, and runtime conditions for the baseline and candidate, and repeat at least three times.

CHAPTER 1 / 5

Separate roles and output contracts before choosing a model

Break a broad request such as “a local model that handles Korean well” into task stages first. A generative model that produces questions and answers, Vision·OCR that reads tables and text from images, an embedding model that turns documents into vectors, a reranker that reorders retrieval candidates, Speech-to-Text that turns speech into text, and Text-to-Speech, which works in the opposite direction, all have different inputs, outputs, and errors. Handing every function to one large generative model blurs the measurement criteria and the location of failures.

Write an output contract for each stage: correct answer·evidence·format·refusal for generation; recall of relevant documents within top-k for embedding; the rank of the correct document for a reranker; field·character accuracy for OCR; and error rate and latency for speech. Instead of “looks good,” first build a small gold set that includes real user language, short and long inputs, tables·code·noise, and failing inputs.

Model-card benchmarks are a starting point for finding candidates, not evidence that a candidate passes your task. Public rankings can change on local tasks when dataset language·prompt·evaluation methods differ. Use the same inputs, output parser, sampling, and rubric for every candidate, and preserve agreement and disagreement on items requiring human judgment.

Approve each role separately even if a candidate claims multiple roles. Vision input does not guarantee Korean table OCR accuracy, and long-context support does not guarantee evidence fidelity or memory feasibility at that length. Recording pass or hold by role allows replacing only the failing stage rather than the whole system.

A single Korean internal policy Q&A request fanning out into five roles - generative model, Vision OCR, embedding, reranker and speech STT TTS - each with its own input and output, metric and failure symptom
How to read the figure No model can be judged a pass until roles and output contracts are separated. Recording pass and hold per role means that if one stage fails, only that stage needs to be replaced.

To recap the key points

  • Split a task into stages such as generation, retrieval, reranking and speech, and define ground truth for each stage.
  • Fix the required language, modality, context, and format, and the boundaries for human verification, before searching for candidates.

How this connects in practice

For Korean internal-policy Q&A, evaluate embedding document recall, reranker top ranks and generator evidence citations in separate tables.

To summarize this chapterChat generation, code, Vision and OCR, embedding, reranker, Speech-to-Text, and Text-to-Speech differ in inputs, outputs, and failure costs, so they cannot be chosen from a single ranking.

CHAPTER 2 / 5

Pin the revision and artifact provenance from the official publisher

Do not assume a Hub search result is the original just because its name is similar. Confirm that the organization and repository are the ones the creator's official documentation points to, and pin the exact commit revision. Storing the model ID and revision, download date, and file name, size in bytes, and cryptographic hash in one catalog row lets you identify the actual evaluated artifact even if it is later deleted or replaced.

Keep original weights separate from executable artifacts. If you created a GGUF or other quantized file from the original Safetensors, link the source revision, conversion and quantization tool versions, command and parameters, calibration data conditions, and output hash. Even when using community artifacts, if this lineage is broken, only the name "the same model" remains, and differences in quality, security, and speed cannot be reproduced.

The tokenizer, chat template, processor, and config are also part of the artifact. If you move only the weights to a new revision while keeping the previous tokenizer, or apply a different role template to an instruct model, response formatting and termination can change. Instead of copying every file unconditionally, pin the pairings required by the model card and config in a manifest and test the actual rendered prompt.

Check the trust boundaries of downloaded file formats and custom code. Formats whose deserialization can trigger code execution, such as the Pickle family, and repositories and install scripts that require `trust_remote_code` need isolated review. Do not broaden execution privileges just because the source is official; keep the required file allowlist, scanner results, and reviewer in the evidence.

A provenance chain linking five stages (official organization, exact revision, original files, converted and quantized artifacts, and evaluation and rollback retention), each with the record to pin and the symptom when the link breaks
How to read the figure Even with the same name, it is not the same model without a revision and hash. If even one link in the lineage breaks, only the name remains, and quality, security, and speed differences cannot be reproduced.

To recap the key points

  • Trace community conversions to the original revision, conversion recipe, tools, and output hash.
  • Record immutable identifiers that allow re-downloading, not just a mutable latest or tag.

How this connects in practice

When comparing two GGUF files with the same name, you cannot explain performance differences without base revisions, tokenizers, quantization methods, and checksums.

To summarize this chapterA family name alone is insufficient for reproduction. Pin the official organization, exact repository and revision, files and hashes, and conversion and quantization lineage in one row.

CHAPTER 3 / 5

Read variant·modality·context and limitations in the model card

First, distinguish the base model from instruction-tuned variants. A base model is the starting point of next-token training, while instruct and chat variants may assume conversation and instruction data and a specific template. For suffixes such as coding, safety, multilingual, or vision, also check the producer's definition. Do not let a use guessed from the name override the card's intended use or the architecture and processor config.

Parameter count is not memory bytes or speed. Dense and Mixture-of-Experts models may differ in total versus per-token activated size, and embeddings·vision towers may be excluded from the count. Check actual repository configs and file lists, then separately measure bytes by precision·quant, load peaks, and runtime workspace.

Context and modality are conditional. Even if an official card lists maximum context or image input, per-language recall for long inputs, image resolution/count, processor settings, and memory/latency need separate checks. Test truncation, lost-in-the-middle, OCR fields, and p95 on minimal, representative, and longest inputs; record unsupported combinations as hold reasons, not blanks.

Read the model card's limitations, training data overview, evaluation, and risk descriptions with the same weight as its marketing claims. Map known language·domain·factuality·safety limits to your conditions of use, and decide where people review and which automation to prohibit. If the card lacks information, do not assume the best; record it as an unconfirmed evidence gap.

To recap the key points

  • Distinguish parameter labels, actual file bytes, and total·activated parameters.
  • Do not turn official context and modality limits into a guarantee of quality, memory, or latency on your hardware.

How this connects in practice

Conditions vary even within a family, as in Gemma 3's size-dependent context and modality differences. Compare the repository name with the exact variant in the model card.

To summarize this chapterTreat base·instruct variants, sizes·architectures·modalities·context·languages, and usage restrictions within the same family as separate candidates so you do not compare the wrong artifacts.

CHAPTER 4 / 5

Review open-weight status and license·usage policy as independent gates

Open-weight usually describes access to weights, not automatic compliance with the Open Source Initiative’s software definition or disclosure of training data·recipes. Keep separate catalog columns for weight access, code license, model license, and data disclosure scope. Reducing “open” to yes/no loses the actual permitted scope.

Check commercial use, redistribution, derivative models and outputs, attribution and notice, user scale, and prohibited uses in the exact license text and usage policy. Hub metadata tags are useful for discovery but do not replace the license text. The assigned reviewer decides whether the organization's purpose, region, and distribution method fall under the conditions and records the URL, revision, and review date.

Adapters, merges, and quantized artifacts can also constitute distribution. Confirm that the base license, dataset and code licenses, and conversion-tool obligations do not conflict, and decide whether to provide the card and notices with them. Even when only an API is offered and no files are given to external customers, acceptable-use, privacy, and input and output responsibilities remain.

If the license or policy is ambiguous, the verdict is hold regardless of passing performance tests. Engineers do not guess and approve decisions that require legal advice, and alternative candidates are kept separate from a limited internal pilot. When a new release arrives, review the terms diff as well as the hash so the scope of the earlier approval is not exceeded.

To recap the key points

  • Preserve the license file and acceptable use policy at the exact revision.
  • Do not substitute a short license tag on a model card or a single word like “open” for a legal judgment.

How this connects in practice

Terms can change between releases even within the same family, so do not automatically copy a previous review result to a new revision.

To summarize this chapterAvailability of weight downloads, disclosure of source code and training data, and commercial-use, redistribution, derivative-work, and usage restrictions involve different rights and obligations.

CHAPTER 5 / 5

Run a catalog with runtime fit, task evaluation, and rollback

Runtime compatibility is broader than loading a single file. Check architecture and operators, tokenizer and chat template, image processor, context and batch, quant kernels, and tool and structured-output features on the exact hardware, OS, driver, and runtime versions. Use startup logs and profilers to confirm expected device placement and CPU fallback, and test with failing inputs to make sure the wrapper does not silently ignore unsupported features.

Run role-specific gold sets on baselines and candidates under identical conditions. Evaluate generation by correct answers·evidence·format·refusal, embedding by recall@k, reranking by ranking metrics such as MRR·nDCG, and OCR·STT by field·character·word errors and failure costs. Do not merge everything into one mean; first examine mandatory gates for subsets such as Korean, long inputs, numbers·tables, safety, and empty retrieval.

Track cold loading, warm TTFT, prefill/decode, p50/p95, peak VRAM/RAM, concurrency, errors and sustained load. Repeat at least three times and pin model, revision, artifact, template, prompt, output, sampling and runtime in the manifest. If candidates use different optimizations, retain a common baseline to separate model effects from execution settings.

Before promotion, roll back to the previous artifact and runtime and test whether the same failing inputs recover. Each catalog row records the owner, approver, last review date, and re-review triggers such as official source or license changes, model or runtime upgrades, and task drift. The recommendation list is not a finished set of bookmarks but an operational registry in which pass, hold, and retired statuses change with new evidence.

To recap the key points

  • Pin the input, output, sampling, and runtime conditions for the baseline and candidate, and repeat at least three times.
  • Include review dates, owners, re-review triggers, and rollback to the previous artifact in the catalog lifecycle.

How this connects in practice

Even if the candidate’s average quality is the same, if Korean numeric extraction format and p95 fail, do not deploy it fully; fix the cause and retest the same failure set.

To summarize this chapterEven candidates that pass the official card and license review are promoted to a deployment row only after passing role-specific quality, format, p95, memory, and failure-recovery checks on the exact hardware, runtime, and template.

INTERACTIVE LAB 1 / 2

Lab 1 · Model candidate provenance and terms-of-use approval lab

Enter values in the browser and check the execution results and the failure and recovery paths. No commands are ever sent to real equipment or the NAS.

Approve role candidates' provenance, terms of use, and execution path

Create one candidate row with the exact role, official distributor and revision, artifact, and model-card, license and runtime evidence instead of choosing a popular name. The defaults intentionally fail.

Situation
A community GGUF was registered as a candidate for internal Korean document generation based only on a post saying it runs well, but its original revision, license, and conversion lineage are unknown.
Goal
Make each role candidate traceable to its official source, immutable artifact, terms of use, and exact execution stack.
Prerequisites
Prepare the creator's official documentation, model card and license, repository commit, downloaded file hashes, conversion manifest, and local runtime logs.
Success criteria
An exact ID, revision, and hash exist, and all five pieces of evidence are confirmed: source, card, license, artifact security, and runtime.
  1. Choose one role the candidate will take in a task stage.
  2. Enter the official repository's exact ID and commit, and the hash of the artifact you will actually evaluate.
  3. After verifying all five evidence items Candidate provenance gate run to find and address gaps.

Evidence limits: Inputs and checkboxes practice the review procedure and do not verify the actual repository, license, file hashes, or runtime. A passing screen cannot be submitted in place of the original source text, security scans, build manifest, or execution logs.

INTERACTIVE LAB 2 / 2

Lab 2 · Role-based evaluation and deployment promotion lab

Enter values in the browser and check the execution results and the failure and recovery paths. No commands are ever sent to real equipment or the NAS.

Promote deployments using per-role quality, p95, memory, and rollback

Pass predefined quality, format, performance, and failure-recovery criteria on the same actual workload as the baseline, rather than relying on public benchmarks. The defaults intentionally fail.

Situation
The new quant candidate has a high average score, but Korean numeric-field accuracy falls below the criterion, p95 exceeds the target, and memory crosses the safety line at maximum input.
Goal
Evaluate role-specific gold sets, user latency, memory and failure/rollback evidence through one deployment-promotion gate.
Prerequisites
Prepare baseline and candidate manifests, normal, boundary, and failure gold sets, repeated raw results, profiler evidence, and previous artifacts and runtimes.
Success criteria
Quality, format, p95, and 90% memory pass, with three repetitions, identical evaluation, failure review, and rollback recovery confirmed.
  1. Before seeing candidate results, pin the role and the required quality, format, p95, and memory targets.
  2. Enter actual measurements and repetition counts for the same workload, along with subset-failure and rollback evidence.
  3. Run deployment promotion gate Then fix one cause and repeat the same failure set and full regression suite without lowering targets.

Evidence limits: This calculation only judges the results the user entered; it does not run the model, evaluation set, or hardware. Without actual raw output, profiler data, reviewer records, and rollback logs, it is not evidence for deployment approval.

KEY TERMS

Key terms in this unit

Open-weight
A distribution form that provides access to model weights; code and data disclosure and usage rights must be confirmed separately in the license and policy
Model card
A document in which the creator describes intended use, structure and variants, evaluation and limitations, and terms of use
Provenance
Provenance lineage from the official source organization and revision through conversion and quantization to final deployment artifacts and hashes
Reranker
A separate model that re-scores retrieved candidate documents by relevance to the question and reorders them

UNIT WORKBOOK

Exercises and worksheets for applying concepts to new situations

Start by checking basic principles, then expand to practical workplace decisions. After submitting an answer, you can see why every option is correct or incorrect, not just the correct answer.

Basic Question 1

On the Hugging Face Hub, an official original and a community GGUF with the same name both appear. Which is the most appropriate catalog procedure for identifying the candidate?

Choose an answer
Basic Question 2

An open-weight model's license tag is shown on the Hub. What is the safest way to approve an API for external customers and redistribution of quantized files?

Choose an answer
Apply Question 3

An instruct model whose official card lists long context and Vision support loads in a local runtime, but image questions return empty answers and some operators run on the CPU. What is the first step?

Choose an answer
Apply Question 4

In Korean policy RAG, a new candidate has a high overall average, but embedding recall and numerical answer format each fall below essential thresholds. What is the most appropriate decision?

Choose an answer
Capstone Question 5

Which deployment plan is most complete for replacing an existing open-weight model with a new quantization and runtime candidate?

Requirements are approved official provenance and licensing, 95% Korean evidence quality, 98% format compliance, p95 of 2 seconds, peak memory at most 90%, and rollback within 15 minutes.

Choose an answer

PERSONAL WORKSHEET

A learning worksheet you adapt to your own environment

Your input remains only on the current browser screen and is not stored or transmitted externally. Use categories and pseudonyms instead of actual sensitive information.

OFFICIAL SOURCES

Verify against official sources

Technical, compatibility, and model information reviewed: August 2026

CORE UNIT 2 / 3

Ollama·MLX·vLLM runtime tools

First pin down the workload for personal chat·research·Apple Silicon·multi-user serving, then select and promote the Ollama, llama.cpp, MLX LM, Transformers, or vLLM runtime based on artifact·hardware·feature·operational evidence.

Difficulty
Practical
Structure
Lessons 5 · Labs 2 · Assessment

Diagrams and tables: composed by the author using each lesson's official primary sources. Find the originals and review dates at the end of that lesson.

NEW HIRE ONBOARDING

Start in the order you would receive your first assignment

So that even a new hire with no prior IT background can follow along, we start with the situation, the task, the evidence, and when to report, before difficult definitions.

  1. 01

    Read the situation in one sentence

    Personal experiments on Apple Silicon can compare MLX LM with llama.cpp, but that is not the same choice as a multi-user API on a CUDA cluster.

  2. 02

    Today's assignment

    First pin down the workload for personal chat·research·Apple Silicon·multi-user serving, then select and promote the Ollama, llama.cpp, MLX LM, Transformers, or vLLM runtime based on artifact·hardware·feature·operational evidence.

  3. 03

    Evidence that shows the work is complete

    Do not change the model, quantization, runtime, and driver at the same time.

  4. 04

    When to stop and ask a senior colleague

    Keep only candidates in the intersection of model architecture·artifact format, OS·device·backend, and required features.

Unpack unfamiliar terms first

Runtime
The execution layer that reads the model artifact·tokenizer, computes on the actual device through the scheduler·backend, and delivers CLI·API results
Backend
A runtime's compute implementation that executes operators on a specific device, such as CPU, CUDA, HIP, Metal, or Vulkan
Serving
Operating multiple client requests through an API with authentication, queues, batching, monitoring and error handling

PREREQUISITE CHECK

Three things to check before reading

This is not a test of memorized answers. Think about each question first, then open the explanation to review the foundational concepts used in this course.

1Are a model artifact and a runtime the same thing?

No. An artifact is a bundle of files such as weights, config, and tokenizer; a runtime is the execution layer that reads them, computes on the device through a scheduler and backend, and delivers results through a CLI or API.

2Once the model is loaded, can you assume all computation runs on the target GPU?

No. Some tensors and operators can remain on the CPU, or unsupported features can be silently ignored. Check device placement and fallback, transfers, and the peak of the longest workload in the startup log and profiler.

3Does a successful personal localhost chat mean a multi-user production server is ready?

No. Multi-user service requires authentication, queue/rate limits, p95/error metrics, log privacy, health/restart checks and rollback. Retest using actual concurrent-request distributions.

TEXTBOOK GUIDE

Main text that covers each concept from its background to the criteria for judging it

We explain the material section by section so readers new to IT can connect causes and effects without memorizing terms.

CONCEPT FLOW

How the chapters connect

The chapters are not isolated short answers to memorize. Follow them from left to right to see how each chapter's concepts support the next decision.

  1. 1.Narrow runtime candidates by purpose, artifact, device, and capability
  2. 2.Distinguish Ollama’s convenient execution from llama.cpp’s fine-grained backend control
  3. 3.Use MLX LM for the Apple path and Transformers for Python source-level control
  4. 4.Approve vLLM serving through concurrency, API, and observability contracts rather than model loading alone
  5. 5.Approve runtime changes using identical workloads, fault isolation and rollback
Ollama·MLX·vLLM runtime tools: the overall map. If you lose track while reading the detailed explanations and chapters below, return to this sequence.

CONTROLLED EXPLANATION

Explore the order in which concepts build on each other

It does not start automatically. Play, or select the previous or next step, to see how the current concept connects to the next decision, step by step.

Current explanation · 1/5

Narrow runtime candidates by purpose, artifact, device, and capability

A runtime is the execution layer that computes a model file on real hardware and serves it through an API and queue, so a personal CLI, research code, and a multi-user server cannot be ranked on the same scale.

First fix the single-user, batch, or concurrency target, the target APIs, tools, and embeddings, and the operational boundaries.

Up next: Distinguish Ollama’s convenient execution from llama.cpp’s fine-grained backend control, where this standard continues to apply.

See the full step description
  1. 1. Narrow runtime candidates by purpose, artifact, device, and capability

    A runtime is the execution layer that computes a model file on real hardware and serves it through an API and queue, so a personal CLI, research code, and a multi-user server cannot be ranked on the same scale. First fix the single-user, batch, or concurrency target, the target APIs, tools, and embeddings, and the operational boundaries.

  2. 2. Distinguish Ollama’s convenient execution from llama.cpp’s fine-grained backend control

    Ollama simplifies the localhost API and model management, while llama.cpp handles GGUF·multiple backends and server options directly, but both require pinning the tag·context·template·actual offload. Record Ollama model tags·digests, context, and processor placement from `ollama ps`.

  3. 3. Use MLX LM for the Apple path and Transformers for Python source-level control

    MLX LM is the MLX generation·fine-tuning path for Apple silicon, and Transformers offers flexible PyTorch-based model·processor·training control, but each requires verifying supported artifacts·devices and production boundaries. Check the MLX-compatible artifact, unified memory peak, and Metal execution.

  4. 4. Approve vLLM serving through concurrency, API, and observability contracts rather than model loading alone

    vLLM provides online serving, batching, distributed execution, and observability features, but exact hardware, model, quantization, and feature support, queueing, security, and rollback must all pass under real load. Align the official install, supported model, quantization, and feature documentation with the deployed version.

  5. 5. Approve runtime changes using identical workloads, fault isolation and rollback

    For runtime comparisons, pin artifacts·prompts·load, repeatedly measure cold·warm, quality·p95·memory·errors, and isolate causes through small baselines and previous-backend recovery. Do not change the model, quantization, runtime, and driver at the same time.

The text description below shows the same content without the animation. Your operating system's reduced-motion setting is also respected.
Conceptual explanation 01

Draw the model file and the runtime stack as separate layers

Users feel they chose a single model name, but several layers shape the actual response. The weights, config, tokenizer, and processor downloaded from a repository form the artifact layer, and the chat template turns roles and special tokens into model input. The runtime loads these, batches requests with a scheduler, and runs backend kernels on a device such as a CPU or GPU. In server mode, an API parser, streaming, queuing, and metrics are added. The same model weights can differ in quality, memory, and latency depending on which layer changed.

Ranking Ollama, llama.cpp, MLX LM, Transformers, and vLLM in a single “fastest first” order loses these layers. Their design scopes differ: Ollama centers on model management and the local API experience, llama.cpp on direct control of GGUF and diverse backends, MLX LM on the Apple silicon path, Transformers on broad model·training control in Python·PyTorch, and vLLM on online serving. A convenient choice for one purpose does not necessarily have the features essential for another.

Isolate failures by layer evidence. For mixed roles, inspect rendered chat templates; for load failures, architecture/files and runtime support; for slow responses, queues, device placement, kernels and transfers; for format omissions, API parameters, sampling and model outputs. Saying only 'the same model answers differently' cannot identify changes in artifacts, templates or scheduling. Link input to response with request IDs and manifests.

Runtime changes are software deployments. Manage binary·container digests, package·driver versions and build flags, model·artifact hashes, config, and API contracts as versioned artifacts. Do not assume notebook latest packages or desktop auto-updates match production. Preserve previous images·configs·artifacts and test the same failing input on the previous stack to explain improvements and regressions.

Why does this happen?
Because separating the layers that produce a response is what allows model capability problems to be correctly distinguished from template, runtime, backend, and API problems.
When is it a problem?
Recording only the model name prevents reproducing which artifact·configuration·device path caused quality·latency regressions after a runtime update.
Common beginner misconceptions
Using the same weight file does not automatically make prompts, memory usage·performance, and API results the same across all runtimes.
How to verify it yourself
For one current request, record the artifact, tokenizer and template, runtime and scheduler, backend and device, and API response in order, with versions and logs.
To summarize this sectionA runtime is not merely an app that opens weights. It is the execution layer that processes artifacts·tokenizers through schedulers and backends on actual devices and returns CLI·API results.
Conceptual explanation 02

Write the workload contract for personal use·research·serving first

Personal terminal chat emphasizes installation, model replacement, and a single request’s TTFT·decode and privacy. Research·training needs Python model objects, processors, gradients·checkpoints, and custom code. Desktop applications emphasize localhost API startup·streaming and idle memory; team services require authentication, queue·rate limits, p95·availability, and rolling updates. Calling all four workloads “running a local LLM” blends each candidate’s strengths and defects into an average.

The manifest contains the exact model·revision·artifact hash, tokenizer·template, input·output tokens, batch·concurrency, sampling, and hardware. Also pin normal·boundary·failure inputs, including short chats, long documents, missing evidence, cancellation, invalid schemas, and concurrent mixes of long and short requests. A personal demo runs at concurrency 1 with short prompts, while production traffic accumulates queues and KV cache, so the two cannot be compared with the same single token/s measurement.

Describe required functionality through client behavior, not endpoint names. Specify real requests and expected responses for streaming chunk order, usage fields, structured-output schemas, tool-call arguments, embedding dimensions, image inputs and error statuses. “OpenAI-compatible” is a useful starting point, but supported endpoints and parameters can differ by runtime and version. Automatically test the contracts clients depend on, and explicitly hold unsupported features.

Set non-functional requirements in advance as well. Fix minimum quality and format, p95 TTFT and total latency, throughput, peak memory, error rate, and recovery time before seeing candidate results. Document LAN and internet exposure, authentication and prompt log privacy, offline requirements, and model download paths. Do not approve a runtime that fails a required condition on its overall score just because it is easy to install or has a high average speed.

Why does this happen?
Because runtimes have different design goals, fix your own workload and client contract so that comparison results apply to real use.
When is it a problem?
Approving team service from a one-user demo leaves queue, p95, authentication, cancellation and overload issues undiscovered until deployment.
Common beginner misconceptions
Similar APIs or a successful localhost response do not establish that all production feature, security, and availability contracts are met.
How to verify it yourself
Build a table of user and request distributions, exact features, and quality, p95, memory, security, and recovery thresholds, and approve it before looking at candidates.
To summarize this sectionDifferent runtimes can be compared fairly only when user count, request distribution and features, and quality, latency, security, and recovery goals are defined before choosing candidate tools.
Conceptual explanation 03

Connect artifact format, tokenizer, and template to the runtime exactly

Runtimes do not read every model file interchangeably. llama.cpp centers on GGUF, MLX LM uses MLX-compatible artifacts, and Transformers and vLLM follow supported Hugging Face model and quant paths. An Ollama package also contains the actual base artifact plus template and parameters. Even within the same family, differences in precision, tensor layout and metadata, or processor files change the load path, kernels, and quality. In the candidate table, record the source revision and actual bytes and hash, not just file extensions.

Conversion creates a new artifact. When converting original safetensors to GGUF, MLX or runtime-specific quantization, link converter/quantizer versions, commands, options, calibration and source/output hashes. Check that community conversions have clear sources and recipes. A smaller file loading successfully does not establish equivalent quality or supported features; rerun the same gold set and runtime-log checks as the original baseline.

Verify that the tokenizer, chat template, and processor match the weights. Changes to instruct-model roles, BOS/EOS and stop behavior, vision image processors, or embedding pooling and normalization change model inputs and outputs even for identical displayed text. Do not assume the runtime automatically selects the repository template. Save tokens and rendered prompts immediately before model calls. If you override a template, record its source, reason, and regression results in the manifest.

Custom code and file security are part of runtime selection. Transformers remote code, pickle-family artifacts, and installation scripts broaden the execution boundary. Review required code, use isolated environments and least privilege, and retain only allowed files in the offline registry. Check whether the Runtime automatically updates or downloads from remote repositories; in production, use immutable revisions, controlled caches, and network policy to prevent unexpected artifact changes.

Why does this happen?
If the artifact and input-processing components differ by runtime, the actual computation graph, prompt, and quality differ even within the same family.
When is it a problem?
Pinning only the weights while mixing tokenizers, templates, and processors can silently change role handling, termination, vision, and embedding results.
Common beginner misconceptions
Matching model names and quant labels do not make GGUF·MLX·Transformers artifacts bit-identical or compatible with every runtime.
How to verify it yourself
Record source-to-converted-artifact hashes and tokenizer, template, and processor revisions. Compare rendered inputs immediately before runtime against the baseline.
To summarize this sectionGGUF, MLX, safetensors, and quantization are not mere file extensions; they are distribution contracts that together determine runtime support, conversion provenance, and input format.
Conceptual explanation 04

Use Ollama as a convenient local API while observing hidden defaults

Ollama's official API provides model interactions such as generate·chat·embed at the default localhost address after installation. It makes personal experiments and desktop app connections quick to set up, but simplicity does not remove run conditions. Preserve the model name·tag, digest and details, Ollama release, the Modelfile's FROM·TEMPLATE·PARAMETER·SYSTEM, and the API request. If you record only the `latest` tag, a later pull may fetch a different artifact and the result may not be reproducible.

Distinguish the model architecture's maximum context from the current runtime allocation. Official Ollama documentation notes that a larger context increases memory requirements and recommends checking PROCESSOR and CONTEXT in `ollama ps` for allocated length and offloading. A short prompt running successfully does not prove target context and concurrency stay on GPU. Record system RAM/VRAM peaks, processor split, TTFT, and decode at the longest input.

Make local and cloud data paths explicit. Even with the same API shape, a localhost model and a remote cloud model have different boundaries that input crosses. Confirm the actual endpoint through app settings, the model URI, and network logs, and align it with sensitive-data policy. Changing the listen address for LAN use changes the localhost-only threat model, so review an authentication proxy, TLS, rate limits, and per-client access as a new deployment.

Approve an Ollama candidate based on the actual client contract and failure recovery. Test the required features among streaming, structured output·tools·Vision·embeddings, as well as behavior for invalid requests·timeouts and during model load. After an update, run regression on the same gold set and p95 to see whether template·context·backend changed. Confirm that reverting to the previous Ollama version·model digest·Modelfile recovers the same failing input before deciding the desktop or team usage scope.

Why does this happen?
Beneath a convenient abstraction, the artifact·template·context·offload and endpoint determine the result, so the actual state must be recorded.
When is it a problem?
If you record only the tag and "response succeeded," you cannot find why quality or p95 changed after an update switched the model, context, or CPU offload.
Common beginner misconceptions
The fact that Ollama runs easily on localhost doesn't automatically guarantee 100% GPU, maximum context·production security, and original license.
How to verify it yourself
Store exact digests, Modelfile, API requests, and PROCESSOR/CONTEXT from `ollama ps`, then repeatedly measure quality, peak usage, and p95 for the longest workload.
To summarize this sectionOllama's simple pull·run·API experience is an advantage, but runs become reproducible only when model digest, template·context, and processor split·network boundary are recorded.
Conceptual explanation 05

Treat llama.cpp as a runtime with visible GGUF, backend, and server options

The official llama.cpp repository provides GGUF, CPU, Metal, CUDA/HIP, Vulkan, other backends, and CPU+GPU hybrid inference. This list does not guarantee equal support for every model architecture, quantization, operator, and endpoint on every backend. Pin the repository commit, compiler and build flags, binary and container digests, backend, and runtime logs. Even for prebuilt binaries, check the release asset, hash, and CPU instruction set.

Check architecture, quantization, tokenizer and template in GGUF metadata, and record model and mmproj file hashes. If converted directly from the source model, preserve the recipe. With convenience downloads such as `-hf`, check the exact repository, quantization selection and cache object instead of depending on changing defaults. A llama.cpp-compatible community artifact is not necessarily the official model producer's original; license and provenance are separate gates.

Offload is not just a layer count. Use startup logs to check tensor·operator placement on CPU·GPU, host-device transfers, system RAM·VRAM peaks, and changes across context·batch sizes. A hybrid setup may run a model larger than VRAM, but link and CPU bandwidth can push TTFT·decode·p95 beyond targets. Compare full-GPU, hybrid, and CPU baselines on the same workload, and do not hide unexpected fallback.

When using llama-server, separately verify operational features such as the API, parallel decoding, continuous batching, and metrics. Check the listen address, authentication and request limits, context sharing, slot and queue behavior, and health and readiness. Do not carry a single-user CLI success over as approval for a multi-user server; measure p95, errors, and cancellation at each concurrency step. Before updating, confirm you can roll back to the previous binary, preset, and GGUF and recover the same failing request.

Why does this happen?
Because llama.cpp offers so much freedom in build, backend, offload, and options that support and performance results cannot be reproduced unless the exact combination is recorded.
When is it a problem?
Looking only at GGUF loading and GPU activity misses p95 bottlenecks caused by CPU fallback for some operators, hybrid transfers and server queues.
Common beginner misconceptions
A supported-backend list does not mean every model, quantization format and feature is fully accelerated and production-ready on that device.
How to verify it yourself
Store commit, build flags, binary hash, GGUF metadata/hash, and startup placement, then repeatedly measure CLI and server workloads separately.
To summarize this sectionllama.cpp's broad hardware and GGUF support becomes a strength when you directly verify the exact build, backend, operators, and server options.
Conceptual explanation 06

Separate MLX LM into Apple silicon experiment·training paths and the server boundary

The official MLX LM repository provides a package for text generation, quantization, and LoRA·QLoRA fine-tuning with MLX on Apple silicon. Do not apply NVIDIA CUDA commands or kernels merely by renaming them. Record the exact Mac chip·memory·OS, Python·MLX·MLX LM versions, source model, and MLX artifact hash. For community conversions, check source revision·quant recipe and tokenizer·template, and compare quality against the original baseline.

Unified memory makes access to a large pool convenient, but the OS, applications, weights, KV cache, activations, and workspace share the same capacity and bandwidth. Measure per-phase peaks for generation, batching, and fine-tuning, and check memory pressure, swap, Metal execution, and thermals. Do not extrapolate one successful prompt generation to large batches, long contexts, or completed LoRA jobs. When comparing with llama.cpp Metal on the same Mac, control for artifact and prompt differences.

Separate the purposes of MLX LM commands. Chat REPL centers on session context and personal interaction; generate on reproducible prompt execution; batch on throughput; and fine-tune on dataset·checkpoint·validation. Pin sampling·seed·template, batch·sequence, and checkpoint recipes. For training candidates, separately test job time, activation peak·disk, resume, and adapter rollback as well as inference quality.

The official MLX LM server documentation states that it implements only basic security checks and is not recommended for production. The localhost API is convenient for development, but do not expose it directly to a LAN or the internet. If production is required, choose a separate supported path that provides authentication, TLS, request limits, and observability, or validate a proxy and threat model. Do not treat success on an “OpenAI-like” endpoint as approval for availability or security.

Why does this happen?
Because MLX LM's advantages are tied to Apple silicon and the MLX workflow, and generation, training, and the server have different operating conditions.
When is it a problem?
Approving batch·LoRA and external APIs from a single generation run on a Mac means memory pressure, job failures, and missing authentication are discovered only after deployment.
Common beginner misconceptions
Sufficient unified memory or a running MLX LM server does not automatically provide every CUDA workflow or production security.
How to verify it yourself
On the exact Mac, MLX artifact, and version, measure generation, batch, and training separately, and for servers check the official limits and actual network and security boundaries.
To summarize this sectionMLX LM provides generation·quantization·fine-tuning on Apple silicon, but compatible artifacts, unified memory·Metal execution, and the production limits of the official server must be considered together.
Conceptual explanation 07

Pin Transformers as the reference path for the original architecture and Python pipelines

Transformers flexibly handles Hugging Face models, tokenizers, and processors in Python and PyTorch and connects them to generation, evaluation, and training code. Do not interpret this flexibility as automatic optimization on every device. Align supported Python and PyTorch requirements from the installation documentation, GPU drivers, and device checks with exact versions. Preserve virtual environments, lockfiles, and package hashes, and keep source-install results separate from stable-release results.

`from_pretrained` links a repository to the local cache. In production, pin the exact revision, allowlisted files, and local cache objects, and check offline mode·network policy. Make sure an update to the main branch does not automatically change the deployment artifact. Match the tokenizer·processor and config revisions to the weights, and put `trust_remote_code`, pickle, and custom extensions through source review·sandboxing and least privilege.

Using Transformers as a baseline allows detailed observation of the original precision, architecture, and model outputs. Save rendered templates, token IDs, dtypes, device maps, layer placement, and generation configurations. If GGUF, MLX, or vLLM candidate results differ, compare them with the Transformers baseline using the same source and prompt to isolate artifact quantization, template, and scheduler effects. The baseline itself also varies with drivers, kernels, and sampling, so pin its versions.

A Python notebook or pipeline is not a production service. When a multi-user API is needed, choose a serving layer that provides queues, async cancellation, authentication·rate limits, health·metrics, and process isolation. Do not bind research code directly to a web port. Separate training·evaluation from the serving environment while sharing the model·tokenizer·gold set contract, and automatically check for regressions that updates cause in the downstream runtime.

Why does this happen?
Because Transformers offers broad model control, the environment, remote artifacts, and device mapping directly affect results and security.
When is it a problem?
Running unpinned packages, main revisions, and remote code directly in notebooks can leave you unable to reproduce results and cause you to miss supply-chain risks and device fallback.
Common beginner misconceptions
A Transformers pipeline running once does not mean the script is a multi-user production server or the most optimized runtime.
How to verify it yourself
Save the environment lock, exact model and processor revisions, device map, and rendered prompt, then rerun the baseline in an offline clean environment.
To summarize this sectionTransformers offers direct control over models, processors, training, and custom code, but this flexibility requires responsibility for Python, PyTorch, drivers, caches, security, and operations.
Conceptual explanation 08

Evaluate vLLM as a serving candidate requiring concurrency, scheduling, APIs, and observability

The official vLLM documentation broadly covers GPU, CPU, and TPU installation, supported models, and online serving, pooling, quantization, and observability features. However, do not assume that features in the latest documentation apply retroactively to the older version you deployed. Check the container digest, vLLM, PyTorch, and driver versions, GPU and topology, model and quantization artifacts, and attention backend against the exact support page. Distinguish the risks and rollback of nightly and source builds from those of stable images.

OpenAI-compatible servers help client migration, but verify the actual endpoint contract. Pin the requests the app uses among chat·responses, streaming chunks, structured output, tool-call·reasoning parsers, embeddings, and usage·error fields. Model-specific chat templates and parser support may be needed, and options may vary by version. Test with invalid·boundary requests whether unexpected fields are silently ignored.

Measure serving performance while the scheduler batches multiple sequences. At concurrency 1 and representative, target, and overload levels, use realistic input and output length distributions to measure request throughput, queue time, TTFT, inter-token latency, p50, p95, p99, peak memory, and errors. Even if continuous batching increases total tokens/s, long requests may worsen the p95 for short requests, or KV-cache pressure may block admission. Also verify resource reclamation after cancellations and timeouts.

Production needs authentication, rate limits·quotas, readiness during load, metric·log privacy, and rolling restarts. Test server statuses and retry safety during OOM·worker crashes and model-load failures. Distributed execution adds topology·communication and node failures as variables. Observe quality·schema·p95·errors in canary and measure the time to return traffic to previous images·artifacts.

Why does this happen?
vLLM's value shows in concurrent request scheduling and serving features, so only reproducing actual clients, load, and operational failures provides grounds for selecting it.
When is it a problem?
Looking only at single-prompt token/s misses queue and tail latency, unsupported parsers and endpoints, and worker and request recovery after OOM.
Common beginner misconceptions
“OpenAI-compatible” and “high-throughput” do not automatically guarantee support for every model·quant·client parameter or production security.
How to verify it yourself
On the exact image and support matrix, run client contract tests, measure quality, p95, peak, and errors at each concurrency step, and run canary and rollback.
To summarize this sectionvLLM approval depends on an exact supported stack, the client contract, and queue behavior, p95, memory, and recovery under actual request distributions, rather than a feature list or single-request speed.
Conceptual explanation 09

Approve the runtime change with the same workload and a small successful baseline

For a fair comparison, fix the source model and artifact, tokenizer and template, prompt, output, and sampling settings, context, batch, and concurrency, and the hardware. If runtimes support different artifacts and cannot use the same quantization, disclose the source revision, conversion recipe, and byte and quality differences, and keep a common Transformers or existing runtime baseline. Do not show only the candidate's best-performing settings; record the common settings and tuning differences together. Repeat at least 3 times to separate cold and warm runs from variance.

The measurement table includes download, loading, compilation, warm TTFT, prefill, decode, end-to-end and queue time, and request and token throughput. Link peak VRAM and RAM, CPU/GPU placement and transfers, utilization, power, temperature, errors and cancellation. Examine p50, p95, p99 and distributions by input length and concurrency rather than one average. Approve performance results only when the same candidate’s task quality, evidence, schema compliance and safe refusals pass predefined thresholds.

On failure, return to the smallest passing state. Verify exact outputs and device paths with short text, concurrency 1 and default precision, then add context, batch/concurrency, vision, tools and schemas individually. Find the first evidence that changed with symptoms among startup, rendered prompts, operators, memory, queues and networks. Hold combinations that succeed accidentally after changing model, quantization, runtime and driver together because they lack root-cause evidence and a reproducible recipe.

Before promotion, restore the previous runtime image and binary, config and API contract, and artifact. Send the new candidate's failing inputs to the previous backend and test whether quality, format, and p95 recover and whether the traffic switch and cached and in-flight requests are handled safely. Switch over fully only after the canary, and set regression triggers for version, driver, model, and task changes. The final conclusion is not a brand ranking but a pass or hold, with limitations, for the exact workload, stack, and date.

Why does this happen?
Because performance gains become operational value only when runtime differences are separated from artifact and configuration differences and you can recover from real incidents.
When is it a problem?
Changing several variables at once and keeping only the successful values makes it impossible to find the cause of regressions or to return safely to the previous service.
Common beginner misconceptions
One best tokens/s result or successful model load does not represent quality, p95, memory, errors or production readiness.
How to verify it yourself
Repeat normal, boundary and failure cases under the same manifest, and reproduce small-baseline recovery, canary testing and rollback to the previous stack using the same inputs.
To summarize this sectionA runtime comparison becomes a reversible operational change only when you change one variable at a time, repeat runs with the same artifact, input, and load, and prove both the cause of failures and recovery to the previous stack.
Conceptual explanation 10

Redesign the security boundary when moving from localhost to the LAN or the internet

For a personal API bound only to localhost, processes on the same host are the main clients, but exposing it to a LAN or the internet brings in untrusted clients and networks. Changing only the listen address and firewall is not a feature change but an expansion of the security boundary. Draw a data flow showing who can use which models, documents, and tools, and where inputs and outputs pass through and are stored. Confirm the default bind, authentication, and proxy configuration of Ollama, llama-server, MLX server, and vLLM in the exact release documentation and on the actual socket.

Distinguish authentication from authorization. Even with a valid API key, the server must check whether the user has the right to access the specific model, adapter, RAG documents, and tools. Do not put a master key in a browser client; use short-lived, least-privilege credentials and TLS. Hiding model names or making URLs hard to guess is not access control. Place admin endpoints, model pull and delete, and file tools on a narrower network and role than general inference routes.

Limit request resources. Without limits on input context, output tokens, image size·count, batch·concurrency, queue·timeout, and per-user quotas, a few long requests can exhaust KV cache·memory. Test that slots·memory are reclaimed after cancellation, and that overload returns a clear status without triggering infinite retries. Rate limits should reflect not only average request counts but also token·memory cost and high-priority traffic.

Logs and metrics can contain prompts, documents, tool arguments, model and adapter identifiers, and user identities. Minimize collection of raw content, redact secrets and personal information, and define access, retention, and incident procedures. Do not leave debug mode permanently on in production; trace samples must also follow data policy. Even after passing the threat model, authentication proxy, and limits, manage the runtime's own vulnerabilities, dependency updates, and rollback separately.

Why does this happen?
Because exposing a service on the network changes who can access it, the attack surface, and resource contention, the success of a personal run cannot establish safety.
When is it a problem?
Changing only the bind address can expose unauthenticated model and administration endpoints while introducing OOM from long requests and leakage through prompt and document logs.
Common beginner misconceptions
Using a local model does not mean that data is safe or that permissions are automatically isolated per user when the API is exposed to the LAN.
How to verify it yourself
Test the actual listening sockets, proxy and firewall, per-user permissions, token and queue limits, and redacted logs using an approved account, an unapproved account, and an overload request.
To summarize this sectionExposing a local runtime API to a network adds users, permissions, secrets, request resources, and log privacy to the picture, so do not simply change the bind address without a separate threat model and approval.
Conceptual explanation 11

Record observations, costs, upgrades, and retirement in the runtime registry

Registry rows hold purpose, owner, runtime·binary/container digest, model artifact·template, hardware·driver, client contract, and quality·p95·memory thresholds. They also link development·canary·production environments and traffic ratios, the latest evaluation, and the rollback target. A single line such as “currently using vLLM” does not show which version·model and settings actually respond to users. Deployment inventory and metric labels must use the same immutable IDs to narrow the impact during an incident.

Observability must explain the user's request path. Link request rate and queue depth; TTFT, inter-token, and end-to-end p50, p95, and p99; token throughput; errors and cancellations; and VRAM, RAM, and device placement. Measure model quality and schema failures with samples separate from infrastructure metrics while protecting privacy. Align alert thresholds with predefined service levels and error budgets rather than simple CPU utilization, and link rising queues and OOM to runbooks for concurrency limits, smaller models, and rollback.

Cost includes not only runtime license prices but also GPU and CPU time, idle and load memory, power, storage, network, and operations staff. For a single user, setup and update time matters; for a team service, cost per request, spares, and availability matter. Compare costs only among candidates that pass required quality, p95, and security, and do not approve a failing candidate because it is cheap. Attach the measurement date, traffic, and hardware, and recalculate after workload changes.

An upgrade is a new candidate, not an overwrite of an existing record. When releases, drivers, models, templates, or feature flags change, check official support and vulnerability notices, then run the same regression, load, and failure tests in a canary. Before retirement, check client and artifact dependencies, caches, adapters, and rollback retention. Preserve evidence after traffic reaches zero and access is blocked. Do not delete the previous runtime so early that a failed canary has no rollback path.

Why does this happen?
Because runtime and deployment conditions keep changing, approval results go stale quickly without the current stack, thresholds, owner, and re-review triggers.
When is it a problem?
Overwriting existing rows with the latest update and deleting the previous image makes it impossible to trace the scope and cause of quality or p95 regressions, or to roll back.
Common beginner misconceptions
A runtime that passed in production once is not permanently approved for every new version, driver, model, and traffic distribution.
How to verify it yourself
Trace the immutable runtime·model stack and metric·owner·rollback from a production request ID, and rehearse update·retirement procedures with a canary failure.
To summarize this sectionEven an approved runtime is subject to changes in version, driver, model, and workload, so manage it in an operational registry with an owner, monitoring criteria, cost and re-review triggers, and safe retirement.

CONCRETE CASES

Check concepts in different situations

Before memorizing definitions, compare how these concepts appear on a personal PC and in real work.

  1. Case 1 · Narrow runtime candidates by purpose, artifact, device, and capability

    Personal experiments on Apple Silicon can compare MLX LM with llama.cpp, but that is not the same choice as a multi-user API on a CUDA cluster.

    Key points to check here: First fix the single-user, batch, or concurrency target, the target APIs, tools, and embeddings, and the operational boundaries.
  2. Case 2 · Distinguish Ollama’s convenient execution from llama.cpp’s fine-grained backend control

    Even with the same GGUF, quality·memory·p95 can differ if the Ollama package's template·context differs from the options passed directly to llama-server.

    Key points to check here: Record Ollama model tags·digests, context, and processor placement from `ollama ps`.
  3. Case 3 · Use MLX LM for the Apple path and Transformers for Python source-level control

    Do not extend a fast MLX LM generation result on a Mac into production security approval for the default MLX LM HTTP server or into CUDA server performance.

    Key points to check here: Check the MLX-compatible artifact, unified memory peak, and Metal execution.
  4. Case 4 · Approve vLLM serving through concurrency, API, and observability contracts rather than model loading alone

    Hold production promotion if p95 TTFT, specific tool calls, OOM cancellation or restart recovery fails, even when throughput is high with eight concurrent users.

    Key points to check here: Align the official install, supported model, quantization, and feature documentation with the deployed version.
  5. Case 5 · Approve runtime changes using identical workloads, fault isolation and rollback

    If JSON output breaks on a new runtime, check differences in chat template, sampling, and schema support before scaling up the model, and test whether the same input recovers on the previous runtime.

    Key points to check here: Do not change the model, quantization, runtime, and driver at the same time.

CHAPTER 1 / 5

Narrow runtime candidates by purpose, artifact, device, and capability

Choosing a runtime means defining which users execute which artifacts on which devices through which interfaces, not simply asking which tool is fastest. Personal terminal chat, Python research·training, desktop localhost APIs, and concurrent team services differ in installation convenience·flexibility·throughput·security·recovery. Even within one model family, GGUF, MLX conversions, Transformers safetensors, and vLLM-supported quantized artifacts differ; start with the files.

The workload manifest includes exact model and revision, artifact hashes, tokenizer and chat template, input and output tokens, batch size, concurrency, sampling, and normal, boundary, and failure inputs. Separate required features into chat completions, streaming, structured outputs, tool calling, embedding and reranking, vision, LoRA, and monitoring. “OpenAI compatible” does not imply identical endpoints, parameters, or error semantics, so test the actual client contract.

Record CPU architecture, system RAM, VRAM or unified memory, OS, driver and backend in the hardware row. Use logs and profiling to verify device detection, actual execution of architecture/quantization operators on the device and absence of unexpected CPU fallback. Successful installation or model loading does not guarantee the execution path or stability at the target context and concurrency.

Do not hide unsupported features when narrowing candidates. Do not assume GGUF-only artifacts can be used as original Transformers models or MLX conversions can be directly loaded into CUDA runtimes. Manage required conversion sources, recipes, output hashes and quality regressions separately. Final candidates must meet purpose, artifact, hardware and feature requirements and support rollback to the previous runtime.

Table that compares four purposes (personal terminal chat, Python research, Apple Silicon experiments, and team multi-user serving) by artifact format, hardware backend, required features, and the command and value to check, listing the surviving runtime candidates and the assumptions filtered out at this stage
How to read the figure A runtime is narrowed by the intersection of purpose, artifact, device and features, not by brand ranking. If any of the four conditions is empty it is not a candidate, and it is promoted only when it can be rolled back to the previous runtime image.

To recap the key points

  • First fix the single-user, batch, or concurrency target, the target APIs, tools, and embeddings, and the operational boundaries.
  • Keep only candidates in the intersection of model architecture·artifact format, OS·device·backend, and required features.

How this connects in practice

Personal experiments on Apple Silicon can compare MLX LM with llama.cpp, but that is not the same choice as a multi-user API on a CUDA cluster.

To summarize this chapterA runtime is the execution layer that computes a model file on real hardware and serves it through an API and queue, so a personal CLI, research code, and a multi-user server cannot be ranked on the same scale.

CHAPTER 2 / 5

Distinguish Ollama’s convenient execution from llama.cpp’s fine-grained backend control

Ollama's official API provides an interface for interacting with models at the default localhost address after installation. It is convenient for quick desktop integration, but recording only a library name or tag lets the artifact·template and context shift. Preserve model details, digest, and the actual Modelfile·parameters, and pin the API version·release. Do not confuse the data paths of cloud and local models; observe network requests at the deployment boundary.

Ollama’s context documentation explains that larger contexts require more memory and directs users to check allocated length and offloading through PROCESSOR and CONTEXT in `ollama ps`. These are runtime settings for the current release·VRAM conditions, distinct from the model card’s architectural maximum. “Running” does not mean 100% GPU; CPU offload can change p95 and power. Record processor split and peaks again at target concurrency·longest input.

The official llama.cpp repository provides a range of backends centered on GGUF, including CPU, Metal, CUDA/HIP, and Vulkan, plus a CPU+GPU hybrid path. Broad support does not mean every model, operator, and feature runs with the same quality and speed in a given exact build. Record the repository commit, compiler and build flags, backend, model and mmproj hashes, and `--ctx-size`, parallel, batch, and GPU layer options in a manifest.

llama-server provides multiple endpoints and features such as continuous batching and monitoring, but releases can change quickly. Contract-test the chat, embedding, reranking, tool, and schema endpoints you need with real requests and errors, and check the listen address, API key, and request limits. Do not expose a personal localhost baseline unchanged as a LAN or container service, and also test health, load and unload, and recovery of requests in flight during shutdown.

To recap the key points

  • Record Ollama model tags·digests, context, and processor placement from `ollama ps`.
  • Verify the llama.cpp build, GGUF hash, backend, GPU layers, context, parallel options, and server features at the exact revision.

How this connects in practice

Even with the same GGUF, quality·memory·p95 can differ if the Ollama package's template·context differs from the options passed directly to llama-server.

To summarize this chapterOllama simplifies the localhost API and model management, while llama.cpp handles GGUF·multiple backends and server options directly, but both require pinning the tag·context·template·actual offload.

CHAPTER 3 / 5

Use MLX LM for the Apple path and Transformers for Python source-level control

The official MLX LM repository provides tools for generation, quantization, and LoRA·QLoRA fine-tuning with MLX on Apple silicon. Confirm that the model is MLX-compatible and identify its source and conversion recipe, then measure OS·application, weight·KV·activation, and workspace peaks in unified memory. Chip·memory·bandwidth and power conditions differ even among Macs, so do not generalize performance from a single “Apple Silicon” row.

Test MLX LM generate·chat·batch and training separately for their purposes. One REPL response does not guarantee batch throughput, LoRA checkpoints, or long-term stability. Pin model·tokenizer revisions, prompt·template, and quant settings, and record Metal device execution, memory pressure·swap, and thermal state. When comparing against llama.cpp Metal, keep the same source model·task·context or explicitly document artifact differences.

The official MLX LM server documentation provides an HTTP API but states that only basic security checks are implemented and it is not recommended for production. Do not hide this boundary or equate an OpenAI-like API with internal production readiness. Limit it to development on localhost. If external exposure is needed, choose a supported production server or an authentication proxy, request limits, observability, and a separate threat model.

Transformers is the reference path for fine-grained work with models, processors, generation, and training in Python and PyTorch. Match Python and PyTorch versions and device drivers as described in the official installation documentation, and pin virtual environments, lockfiles, model revisions, and caches. Review `from_pretrained` update and offline-cache behavior, remote-code risks, and pickle risks. Do not directly expose research notebooks as unauthenticated multi-user APIs.

To recap the key points

  • Check the MLX-compatible artifact, unified memory peak, and Metal execution.
  • Pin Transformers, PyTorch, driver, dtype, and revision in an isolated environment and review custom code.

How this connects in practice

Do not extend a fast MLX LM generation result on a Mac into production security approval for the default MLX LM HTTP server or into CUDA server performance.

To summarize this chapterMLX LM is the MLX generation·fine-tuning path for Apple silicon, and Transformers offers flexible PyTorch-based model·processor·training control, but each requires verifying supported artifacts·devices and production boundaries.

CHAPTER 4 / 5

Approve vLLM serving through concurrency, API, and observability contracts rather than model loading alone

vLLM is a server runtime with online serving, pooling, and documentation for many features and deployment paths. Do not retroactively treat the broad feature list in current documentation as a guarantee for your installed version. Match GPU, CPU, and TPU installation requirements, supported models, attention backends, and quantization compatibility to the exact release, and record the container digest, PyTorch, drivers, and environment in the manifest. Keep nightly and source builds separate from stable releases.

OpenAI-compatible is an interface starting point. Contract-test the chat·responses, streaming, structured output·tool call, embedding, and error·usage fields that the actual client uses. Because the server may be unable to use the chat template from the model repository or may ignore client request fields, store the rendered prompt and response schema. Do not assume that a single API key resolves per-organization permissions·document access.

Serving performance emerges in the scheduler and queue beyond single-request tokens/s. Reproduce arrival patterns from concurrency 1 up to the target, measuring request throughput, queue time, TTFT, inter-token latency, p50, p95, p99, errors, and peak memory. Continuous batching may increase total throughput while long requests worsen the p95 for short requests. Include input and output length distributions, cancellations, and timeouts.

Operations require health and readiness checks, metric and log privacy, rate limits, overload handling, and restarts. Test traffic during model loading, worker state after OOM, rolling updates, and rollback to the previous image and artifact. Distributed serving adds inter-GPU topology, communication, and failure domains, so a single-node pass does not simply carry over. Before full promotion, observe the same quality, p95, and error gates in a canary.

Diagram of the request path through five stages (model artifact load, API request, scheduler and queue, backend·device execution, and response·stream) with evidence and pass criteria in three groups: quality·format, latency·concurrency, and resources·recovery
How to read the figure A runtime is comparable only when each of the five stops leaves evidence. A single average tokens per second hides starvation of long requests, CPU fallback and OOM.

To recap the key points

  • Align the official install, supported model, quantization, and feature documentation with the deployed version.
  • Contract-test OpenAI-compatible endpoints as well for the parameters·stream·tools·errors and authentication the client uses.

How this connects in practice

Hold production promotion if p95 TTFT, specific tool calls, OOM cancellation or restart recovery fails, even when throughput is high with eight concurrent users.

To summarize this chaptervLLM provides online serving, batching, distributed execution, and observability features, but exact hardware, model, quantization, and feature support, queueing, security, and rollback must all pass under real load.

CHAPTER 5 / 5

Approve runtime changes using identical workloads, fault isolation and rollback

In the comparison manifest, record exact source and artifact hashes, tokenizer and template, context, batch, and concurrency, prompts, outputs, and sampling, and hardware and power state. If each runtime must use a different quant that performs best for it, disclose the artifact differences and quality impact and keep a common baseline. Do not change targets after seeing results, and run the same normal, boundary, and failure set at least 3 times.

Separate cold stages such as download, loading and compilation from warm TTFT, prefill, decode, end-to-end latency and queues. Examine peak VRAM and RAM, CPU/GPU placement and transfers, utilization, power, temperature, errors and cancellation together. Do not let one average tokens/s figure hide long-request starvation, CPU fallback or OOM. The same candidate must also pass quality, format and safe-refusal gates.

When an incident occurs, build a small passing baseline. Confirm the exact response and device path with short input, concurrency 1, and a supported precision, then increase context, batch, concurrency, and features one at a time. Separate template errors, unsupported operators, memory, and queue and network issues as the first evidence for each symptom. Do not approve as the final recipe a state that succeeded by chance after several options were adjusted at once.

Before any change, preserve the previous runtime image, config, artifact, and API contract. Send the new candidate's failing inputs to the previous backend to test whether quality, format, and p95 recover and whether traffic switching, state, and caches are safe. Even after the canary passes, set review triggers for changes in version, driver, model, and workload. The conclusion must be a pass or hold for an exact purpose, stack, and date, not “vLLM is fastest.”

To recap the key points

  • Do not change the model, quantization, runtime, and driver at the same time.
  • Preserve failing inputs, logs and the previous runtime image, then promote after canary testing.

How this connects in practice

If JSON output breaks on a new runtime, check differences in chat template, sampling, and schema support before scaling up the model, and test whether the same input recovers on the previous runtime.

To summarize this chapterFor runtime comparisons, pin artifacts·prompts·load, repeatedly measure cold·warm, quality·p95·memory·errors, and isolate causes through small baselines and previous-backend recovery.

INTERACTIVE LAB 1 / 2

Lab 1 · Runtime lab: purpose, artifact, and feature fit

Enter values in the browser and check the execution results and the failure and recovery paths. No commands are ever sent to real equipment or the NAS.

Approve runtime candidates at the intersection of purpose, artifact, platform, and capability

Match the actual purpose, deployment artifact and device backend before choosing a tool name, then check evidence for official support, client contracts and device placement. The defaults intentionally fail.

Situation
In a personal Apple silicon experiment, someone tried to run a GGUF file with vLLM, and the artifact and backend path is mismatched even before the model loads.
Goal
Narrow Ollama·llama.cpp·MLX LM·Transformers·vLLM by the intersection of purpose·artifact·platform·features.
Prerequisites
Prepare the exact model and artifact, tokenizer and template hashes, runtime release support documentation, target client requests, and startup and profiler logs.
Success criteria
The runtime's default artifact and platform path matches, and official support, provenance, contract tests, and device placement are all confirmed.
  1. Choose the actual purpose: personal use, research, Apple workflow, or team service.
  2. Choose the exact runtime, artifact format, and platform and backend to evaluate.
  3. After verifying all four evidence items Run runtime fit gate, then fix the inconsistencies it finds one item at a time.

Evidence limits: This browser does not run runtimes, models, or devices, or look up official support matrices. A passing screen for the selected combination does not replace actual artifact hashes, contract output and startup logs, or profiler results.

INTERACTIVE LAB 2 / 2

Lab 2 · Runtime lab: promote with identical load and recovery

Enter values in the browser and check the execution results and the failure and recovery paths. No commands are ever sent to real equipment or the NAS.

Promote a runtime with same-workload quality, tail latency, memory, and rollback

Assess predefined quality, p95, request throughput, memory safety limits, recovery to a small baseline and rollback to the previous runtime, rather than one tokens/s result. The defaults deliberately fail.

Situation
The new serving runtime was fast for single-user warm generation, but under actual concurrent load quality falls below the criterion, p95 exceeds the target, and peak memory crosses the safety line.
Goal
Compare the baseline and candidate under the same manifest, and combine quality, tail, throughput, resources, and failure recovery into a single promotion gate.
Prerequisites
Prepare the exact image, artifact and template; actual input-length and concurrency distributions; raw results and profiler evidence from at least three runs; and the previous runtime.
Success criteria
Quality, p95, throughput, and 90% memory pass, with an identical manifest, recovery to a small baseline, and rollback to the previous stack confirmed.
  1. Before seeing results, fix the required quality, p95, request throughput, and usable memory.
  2. Enter measurements and repetition counts for the same normal·boundary·failure loads, along with three pieces of change-management evidence.
  3. Run runtime promotion gate Then fix only one of the artifact, template, runtime, or load, and rerun without lowering targets.

Evidence limits: Judging inputs does not execute actual runtimes, clients, workloads or profilers. Do not approve production promotion from a passing screen alone; preserve raw requests/responses, metrics, logs and rollback times.

KEY TERMS

Key terms in this unit

Runtime
The execution layer that reads the model artifact·tokenizer, computes on the actual device through the scheduler·backend, and delivers CLI·API results
Backend
A runtime's compute implementation that executes operators on a specific device, such as CPU, CUDA, HIP, Metal, or Vulkan
Serving
Operating multiple client requests through an API with authentication, queues, batching, monitoring and error handling
Contract test
A test that verifies whether the endpoints, parameters, streams, schemas, and errors the client depends on are actually preserved in the runtime version

UNIT WORKBOOK

Exercises and worksheets for applying concepts to new situations

Start by checking basic principles, then expand to practical workplace decisions. After submitting an answer, you can see why every option is correct or incorrect, not just the correct answer.

Basic Question 1

When running a GGUF artifact for personal chat on Apple silicon, what is the most appropriate first decision for narrowing down candidates?

Choose an answer
Basic Question 2

In Ollama, short questions are fast but long contexts are slow. What is the most appropriate first check?

Choose an answer
Apply Question 3

In llama.cpp, a model larger than VRAM loaded with hybrid offload, but p95 exceeds the target. What is the most appropriate recovery procedure?

Choose an answer
Apply Question 4

The default MLX LM HTTP server responds on localhost on a Mac. Can it be opened directly to multiple internal users?

Choose an answer
Capstone Question 5

Which team service plan for replacing the existing runtime with a vLLM candidate is most complete?

Requirements are 95% evidence quality, 99% schema compliance, p95 of 2 seconds, request throughput of 20/s, peak memory at most 90%, and rollback within 15 minutes.

Choose an answer

PERSONAL WORKSHEET

A learning worksheet you adapt to your own environment

Your input remains only on the current browser screen and is not stored or transmitted externally. Use categories and pseudonyms instead of actual sensitive information.

OFFICIAL SOURCES

Verify against official sources

Technical, compatibility, and model information reviewed: August 2026

CORE UNIT 3 / 3

Adapter·GGUF·Ollama deployment

Track the exact input, tool, config, hash, license, and quality of every conversion from the adapter to merged weights, GGUF, and the Ollama package, and approve a deployable artifact with a safe format, registry, and rollback.

Difficulty
Lab
Structure
Lessons 5 · Labs 2 · Assessment

Diagrams and tables: composed by the author using each lesson's official primary sources. Find the originals and review dates at the end of that lesson.

NEW HIRE ONBOARDING

Start in the order you would receive your first assignment

So that even a new hire with no prior IT background can follow along, we start with the situation, the task, the evidence, and when to report, before difficult definitions.

  1. 01

    Read the situation in one sentence

    Configure the registry so the Adapter v3 manifest links to base commit A, tokenizer/template B, and dataset and training run C, and records the SHA-256 and evaluation report at every edge of merge D→BF16 GGUF E→Q4_K_M F→Ollama manifest G.

  2. 02

    Today's assignment

    Track the exact input, tool, config, hash, license, and quality of every conversion from the adapter to merged weights, GGUF, and the Ollama package, and approve a deployable artifact with a safe format, registry, and rollback.

  3. 03

    Evidence that shows the work is complete

    Check that the FROM base exactly matches the ADAPTER training base, and do not use a mutable tag as the approved identity.

  4. 04

    When to stop and ask a senior colleague

    Record each transformation's source·parameters·environment·output·evaluation and license decision as an independent build record.

Unpack unfamiliar terms first

Artifact lineage
Dependencies and conversion history linking exact source weights and configuration through adapter, merge, conversion and quantization to the package output digest
Safetensors
A data format designed, unlike Pickle, for safe and fast tensor storage; it does not itself guarantee source provenance·quality·license
GGUF
An inference file format in the llama.cpp family that holds key-value metadata, such as architecture and tokenizer, together with tensor information

PREREQUISITE CHECK

Three things to check before reading

This is not a test of memorized answers. Think about each question first, then open the explanation to review the foundational concepts used in this course.

1If the file name is model-final-Q4.gguf, can you tell the exact source and quality?

Cannot be determined. Names and file extensions are mutable labels. Explaining source and behavior requires the exact parent digest, converter and quantizer versions and parameters, GGUF metadata, output SHA-256, and evaluation against the reference.

2If a file is in safetensors format, are its source, license, model quality, and freedom from malicious behavior all assured?

No. Safetensors is a tensor format that reduces pickle code-execution exposure. Digests, provenance, header/key/shape/dtype and resource checks, licenses and behavioral evaluation remain separate gates.

3Can PEFT adapter_model.safetensors run like an independent model without a base?

Usually not. PEFT adapter state does not include base weights, so the exact base revision, tokenizer/template, and config used in training are required. A wrong base can cause load errors or silent behavior drift.

TEXTBOOK GUIDE

Main text that covers each concept from its background to the criteria for judging it

We explain the material section by section so readers new to IT can connect causes and effects without memorizing terms.

CONCEPT FLOW

How the chapters connect

The chapters are not isolated short answers to memorize. Follow them from left to right to see how each chapter's concepts support the next decision.

  1. 1.Define an artifact as a transformable dependency graph, not a single file
  2. 2.Distinguish the risks that safetensors·pickle and hash·signature address
  3. 3.Approve adapter loading and merging using the exact base and before-and-after merge evaluations
  4. 4.Create quantization candidates from a high-precision GGUF and verify metadata, template, and quality
  5. 5.Close deployment with Ollama package·registry·canary and full lineage rollback
Adapter·GGUF·Ollama deployment: the overall map. If you lose track while reading the detailed explanations and chapters below, return to this sequence.

CONTROLLED EXPLANATION

Explore the order in which concepts build on each other

It does not start automatically. Play, or select the previous or next step, to see how the current concept connects to the next decision, step by step.

Current explanation · 1/5

Define an artifact as a transformable dependency graph, not a single file

Adapters, merged models, GGUF files, and Ollama packages are nodes with different purposes and dependencies; explaining identical behavior and recovery paths requires linking the exact base, tokenizer/template, tool, config, and source digests to each output digest.

Use immutable revisions·SHA-256 digests as identifiers instead of mutable names·folders and “final” filenames.

Up next: Distinguish the risks that safetensors·pickle and hash·signature address, where this standard continues to apply.

See the full step description
  1. 1. Define an artifact as a transformable dependency graph, not a single file

    Adapters, merged models, GGUF files, and Ollama packages are nodes with different purposes and dependencies; explaining identical behavior and recovery paths requires linking the exact base, tokenizer/template, tool, config, and source digests to each output digest. Use immutable revisions·SHA-256 digests as identifiers instead of mutable names·folders and “final” filenames.

  2. 2. Distinguish the risks that safetensors·pickle and hash·signature address

    Safetensors is designed to store tensors more safely than pickle, but format safety does not guarantee source trust, content integrity, quality, or licensing. Combine pinned downloads, digest checks, quarantine, and separate review. Untrusted pickles are not deserialized in the production process, even if scan results are clean.

  3. 3. Approve adapter loading and merging using the exact base and before-and-after merge evaluations

    A PEFT adapter does not include base weights, so build dynamic load and merge as separate artifacts, verify the exact base·target·tokenizer, and measure logits·task·critical·operational differences before and after the merge. Check the adapter_model and adapter_config keys, base reference, revision, and targets in a fresh process.

  4. 4. Create quantization candidates from a high-precision GGUF and verify metadata, template, and quality

    GGUF is an inference format that holds tensors and standardized metadata. Check converter and architecture support and the chat template, quantize directly from an approved high-precision source, and re-evaluate quality, memory, and latency for each candidate. Requantizing an already quantized file can increase quality loss, so verify the high-precision source in the lineage.

  5. 5. Close deployment with Ollama package·registry·canary and full lineage rollback

    Bind the Modelfile's FROM·ADAPTER·TEMPLATE·SYSTEM·PARAMETER and LICENSE to source digests·evaluation, verify the actual resolved manifest after package create, and promote through an immutable registry·canary·rollback to the previous full package. Check that the FROM base exactly matches the ADAPTER training base, and do not use a mutable tag as the approved identity.

The text description below shows the same content without the animation. Your operating system's reduced-motion setting is also respected.
Conceptual explanation 01

Read the model artifact as an executable dependency graph

Training may seem to produce one weight file, but production runs a combination of artifacts. A PEFT adapter lacks base weights and requires its adapter configuration and exact base model. A merged model contains full weights combining the base and update, while GGUF contains architecture and tokenizer metadata plus inference tensors. An Ollama package reassembles FROM sources, ADAPTER, TEMPLATE, SYSTEM and PARAMETER. Runtime, storage, licensing and rollback depend on which node you deploy.

The graph starts with exact base weights, configuration, tokenizer, chat template, adapter and dataset/training run. A merge edge converts base plus adapter to merged safetensors; a converter edge produces high-precision GGUF; and a quantizer produces Q4/Q5 candidates. A package edge combines the chosen source and runtime configuration into a manifest/blob. Record each edge's tool commit, dependencies, parameters, environment, input/output SHA-256 hashes, raw logs and evaluations.

Without this graph, when model-final.gguf fails, you cannot tell which base, adapter, template, or quant recipe caused it. Even if a community file's name cites the same source model, its actual revision and conversion may differ. An approved registry keeps node digests and parent digests immutable and moves only the dev, staging, and production aliases to reviewed digests. Never overwrite bytes under the same name.

The artifact owner defines each node's intended use, retention, access, and re-review triggers. Connect the base license and acceptable use, fine-tuning data rights, merge, quantization, and redistribution conditions, and model card limitations. A successful conversion run or included LICENSE text does not grant actual usage rights. Keep quality, security, and license decisions and build provenance as independent evidence.

Why does this happen?
Because deployed behavior combines the weights with the base, tokenizer/template, quantization, and runtime settings, and recovering from errors requires tracing those dependencies back.
When is it a problem?
Keeping only the final file loses source, tool, license and previous-combination information, making reproduction and incident response impossible.
Common beginner misconceptions
Adapters, merged safetensors, GGUF, and Ollama packages are not identical bytes and behavior with merely different extensions.
How to verify it yourself
Starting from the production digest, confirm that following parents reaches the exact base·adapter·template·converter·quant·package and each evaluation report.
To summarize this sectionAdapters, merged weights, GGUF, and Ollama packages are artifact nodes with different inputs, behavior, licenses, and recovery paths, not simply copies of the same model.
Conceptual explanation 02

Distinguish the questions answered by immutable revisions and digests versus provenance

The Hub's official download guide allows branch, tag or full commit-hash revisions instead of the default latest main; commit hashes must be full length. Pin release inputs using repository ID/type, the full commit and an allowed file list. Treat the returned version-aware cache path as read-only input and do not modify cache files directly. Record the snapshot's configuration, tokenizer, weights, model card and code-file inventory.

SHA-256 checks whether file bytes match the bytes identified by the manifest. Calculate it before and after download, during registry upload and node pull, and immediately before loading to detect partial transfers, corruption, and tampering. However, a hash alone cannot establish trust if an attacker changes both the file and its manifest hash. Approved channels, signature and attestation verification, and reviewer policy provide additional grounds for trusting the source manifest.

SLSA provenance describes how an artifact was produced so consumers can verify that it is the expected build and rebuild it if needed. Apply the build type, external parameters, and resolved dependencies from buildDefinition, and the builder and invocation from runDetails, to model-conversion records. Link the converter command, base and adapter digests, quantization type, imatrix, and output subject digest so reviewers can identify hidden inputs.

Provenance does not mean the build is safe or the model is accurate. Verify builder identity·isolation, parameter completeness, and attestation signature policy, and disclose the reproducibility limits of local manual runs. Quality evaluation·license review·malware scanning are separate gates. The registry UI shows digest·parent·builder·review status and evidence on one screen, but does not merge all of their meanings into a single green badge.

Why does this happen?
Artifacts with the same name can change, and byte identity alone does not reveal how they were created or who approved them.
When is it a problem?
Deploying only the latest tag and a filename means a restart can fetch different bytes, and a hash alone cannot prove that it came from an approved build.
Common beginner misconceptions
A matching SHA-256 digest means that the file matches the expected bytes; it does not mean that the file is safe, accurate, or legal.
How to verify it yourself
Check the full source commit, file digest, the inputs, builder and parameters of signed/approved provenance, and independent quality and license decisions separately.
To summarize this sectionA revision pin describes the source version, a digest describes byte identity, and provenance describes the build inputs, parameters, builder, and run. Rebuilds and policy verification are possible only when all three are used together.
Conceptual explanation 03

Turn the attack surfaces of safetensors and pickle into an actual load policy

Restoring a Python object graph with Pickle can trigger imports and callable execution, creating arbitrary code execution risk. The Hub pickle security documentation warns that its scanner extracts imports and flags suspicious items but is not 100% foolproof. Do not approve unknown files that may be pickle-based, such as .bin·.pt·.pth·.pkl, as production identities; perform any essential legacy conversion only in an isolated sandbox without network·credentials, under a disposable user.

The official Safetensors documentation describes a simple format for safely storing tensors compared with pickle. It avoids deserializing code objects, but tensor values may contain NaNs or have unexpected shapes, and file sizes can exhaust resources. Before loading, inspect header size, metadata, the key allowlist, dtype, shape, tensor count, and total bytes. Pin the parser and framework versions and set device-memory limits.

Identify formats using actual magic/header bytes and a parser, rather than the extension. A safetensors directory may also contain configuration, tokenizer files, custom modeling code and pickle files, so inspect the repository inventory. Deny trust_remote_code and executable scripts by default, and verify architecture support in official code and versions. Block unexpected files, symbolic links, path traversal and archive extraction in quarantine.

Behavior evaluation remains necessary after safe loading. Tensor formats cannot prevent weight backdoors, data leakage or malicious tokenizers. Check golden inputs, critical/safety/resource sets, provenance and licenses. Record transitions from quarantine to verified input, candidate registry and approved release; automatically hold on format-scanner failures or unreviewed dependencies.

Why does this happen?
Because loading weight files uses production process permissions and large amounts of memory, and unsafe deserialization, resource abuse, and behavioral risk sit at different layers.
When is it a problem?
Trusting only an antivirus or Hub scanner green check to load a pickle, or skipping companion code, shape, and behavior checks because a file is named safetensors, leaves security and quality defects.
Common beginner misconceptions
Safetensors is not a trusted-model certificate; it is a tensor data format designed to reduce pickle's code execution surface.
How to verify it yourself
Check default denial of unknown pickles, safetensors header/key/shape/dtype/size inspection, the repository inventory, and sandboxed fresh-load and behavior evaluation.
To summarize this sectionAvoid deserializing untrusted pickles and prefer safetensors, but do not trust the format name alone; quarantine and inspect the header, keys, shapes, dtypes, size, provenance, and behavior.
Conceptual explanation 04

Verify the PEFT adapter bundle and exact base compatibility with fresh load.

The official PEFT checkpoint documentation describes adapter_model.safetensors, adapter_config.json, and the README model card, and states that the adapter state_dict contains no base parameters. Compare base_model_name_or_path and revision and peft_type·target_modules·rank·alpha·modules_to_save in the adapter config against the training run manifest. Supplement a mutable base name or null revision with an exact weight hash, and confirm that checkpoint keys·shapes match the actual target report.

Tokenizers, chat templates, and special tokens are dependencies of adapter behavior. If training resized the vocabulary or trained new embeddings or lm_head, include tokenizer files and modules_to_save weights. Compare golden token IDs produced by rendering raw messages with the same template and serving outputs. Copying only the adapter and changing the tokenizer to the latest base version can break role and target behavior even if loading succeeds.

In a fresh process, load the exact base from an immutable cache/registry and inspect adapter keys, missing/unexpected keys and dtypes. Compare golden logits and generations for base-only, adapter-enabled, adapter-disabled and training-reference runs. With a multiple-adapter runtime, recognize that an adapter name is not checkpoint identity and log the resolved adapter digest for every request. Also test hot swaps and restarts for stale adapters remaining in worker caches.

Ollama’s import documentation also states that ADAPTER’s FROM must match the base used in fine-tuning or results may be erratic. Check supported architectures·adapter formats and quant compatibility for the exact Ollama version. A QLoRA source does not imply support for every runtime import. Approve high-precision merge or separate conversion candidates through official paths and evaluation.

Why does this happen?
Because the tensor positions and learned behavior of an adapter update depend on the exact base structure and token sequence, and the file alone contains no base.
When is it a problem?
Attaching it to a similarly named base or latest tokenizer causes shape errors or silent quality drift, and the original training state cannot be recovered.
Common beginner misconceptions
An adapter_config that names a base, or a successful load, does not guarantee exact revision and template compatibility or identical quality.
How to verify it yourself
Compare the training base, tokenizer/template digest, adapter config/key, fresh base-only, enabled, and disabled outputs, and the runtime resolved digest.
To summarize this sectionAdapter weights do not include the base, so manage config and tokenizer changes as a bundle, and confirm through outputs and parameters that the training base digest matches the serving base.
Conceptual explanation 05

Treat merge as a new full-weight artifact build

The PEFT checkpoint documentation explains that merge_and_unload can save a full model, but PEFT-specific methods and unmerge·multiple-adapter·disable features are lost, and not every method·quant setting supports merging. Merge inputs are the exact high-precision base and adapter digest; record the device·dtype·merge tool commit. Do not force a merge into an already quantized base, and do not approve a community-merged file without a parent as a source.

Freeze the dynamic-adapter reference before merging. Preserve the same base·adapter, tokenizer/template·decoding, and raw outputs·logits for frozen task·critical·general sets. Inspect merged tensor keys·shapes·dtypes, missing/unexpected entries, NaN/Inf, and file-shard indexes, then calculate SHA-256. Load it as a full model in a fresh process and evaluate allowed logit/output differences from the reference.

A merged model includes all base weights, so storage·access·redistribution differ from distributing only an adapter. Review the base license, adapter data·license, and derivative-distribution terms against actual use·region·commercial plans. Record parent digests, merge recipe, evaluation·limitations, and dynamic-adapter source in the model card. README metadata does not replace legal approval.

Preserve the original base and adapter bundle for rollback, and do not overwrite the merge output. If a merge bug is found, take down the candidate alias, recover to the dynamic previous path, and retest the exact failing input. Set a policy so the next GGUF converter accepts only the approved merged digest, which keeps a rejected merge from spreading to downstream quants and packages.

Why does this happen?
Because merge changes parameter bytes, runtime features, and distribution rights, and becomes the source for every later conversion, it needs its own release boundary.
When is it a problem?
Deleting the source after seeing only a successful merge makes it impossible to compare against the dynamic reference or to unmerge·rebuild when quality drift·license issues arise.
Common beginner misconceptions
Merge is neither compression of an adapter file nor a metadata change that is fully reversible for every PEFT method.
How to verify it yourself
Compare tensors·logits·task·critical·license between the pinned base+adapter reference and the merged fresh load, and test rollback to the original bundle.
To summarize this sectionMerge is not a convenience step for attaching an adapter but a new build that changes precision·PEFT features·license and storage, so compare it independently against the dynamic reference and preserve the originals.
Conceptual explanation 06

Preserve architecture, tensors, metadata, and template in GGUF conversion

The GGUF specification defines a magic/version header, key-value metadata, tensor information and aligned tensor data. Standardized keys include general.architecture, quantization_version, alignment and model name, version and basename. Use official information tools/parsers to check the header, tensor count, offsets, types and required architecture keys. Do not reject every unknown key, but place missing required values, unsupported versions and invalid offsets on hold.

Use a pinned llama.cpp converter commit and Python dependencies to convert approved safetensors/config/tokenizer digests into high-precision GGUF. Record commands·environment·stdout/stderr, shard·special-vocabulary handling, and output hashes in build provenance. Do not ignore custom-architecture warnings, missing pretokenizers·chat templates, or tensor-mapping mismatches. Do not directly edit source files or manually hex-patch converter output.

Use BF16/F16 GGUF as the conversion reference where possible. Compare the source Transformers/PEFT merged model and high-precision GGUF using identical rendered tokens and decoding to verify vocabulary, rope, architecture mapping, logits, and frozen task/critical outputs. If this stage fails, fix converter, metadata, or source causes rather than changing quant type. Only a digest that passed conversion becomes quantizer input.

Even when a GGUF file contains template metadata, check which precedence and fallback the target runtime uses. Pin the runtime command, context, sampling, and backend commit, and compare the actual prompt dump or token IDs with the reference. When companion files or architecture-specific metadata are required, as for vision, embedding, or MoE, include them in the parent graph. Loading the file and succeeding on one prompt do not demonstrate full feature compatibility.

Why does this happen?
Because if the converter maps tensor, tokenizer, or architecture metadata incorrectly, behavior changes before quantization even starts, and the defect is copied into every later candidate.
When is it a problem?
Comparing only the Q4 result with the source cannot separate conversion mapping errors from quantization loss, which leads to tuning the wrong knob.
Common beginner misconceptions
A .gguf extension and a successful runtime load are not evidence that the source architecture·tokenizer/template·tensors were preserved exactly.
How to verify it yourself
First pass the high-precision GGUF's header, metadata, and tensor inventory checks, plus golden-token, logit, and task evaluations against the source.
To summarize this sectionDo not check only the GGUF extension; first verify against a high-precision reference how the pinned converter mapped the source config, tokenizer, and tensors.
Conceptual explanation 07

Build quantization candidates directly from an approved high-precision source

The official llama.cpp quantize documentation explains that llama-quantize turns high-quality GGUF input into output such as Q4_K_M, and that quantization changes size and inference speed but can introduce accuracy loss. Record the tool commit, input digest, quantization type, threads and imatrix digest, include/exclude and tensor overrides, and output hash. Do not infer source precision, recipe, or tool version from the Q4_K_M string in a community filename alone.

Official guidance warns that requantizing already quantized tensors can yield substantially lower quality than direct conversion from 16/32-bit sources. Require explicit exception review if the parent graph does not reach a high-precision source or `--allow-requantize` was used. Generate Q4 and Q5 independently from approved F16/BF16 GGUF rather than deriving Q4 from an earlier Q5.

Split Evaluation into file parsing/model loading, golden tokens/templates, task/critical/general/long-context quality, and resource use. Compare raw outputs against the high-precision reference with identical prompts, decoding, and runtime. Set allowed quality drops, minimum schema/critical scores, and memory savings before results. On target hardware, repeatedly measure peak memory, first-token and prompt-processing performance, generation rate, p50/p95, and warm/cold states.

Choose an artifact that passes every must-pass gate and meets operational goals, rather than simply the smallest candidate. If Q4 reduces memory but fails critical JSON cases, while Q5 passes memory·p95 and quality requirements, Q5 is the approval candidate. When using Imatrix, record the representative source·rights·hash and leakage checks. Re-evaluate the same frozen set whenever the quantizer or runtime changes.

Why does this happen?
Because quantization is an irreversible precision change, and the source·recipe and per-tensor settings change quality·memory·kernel behavior.
When is it a problem?
Judging only by filename and size can mistake requantized artifacts or different imatrix/converter outputs for the same Q4 artifact and deploy critical regressions.
Common beginner misconceptions
Having the same Q4_K_M name does not mean every model·tool version produces the same bytes·quality·speed.
How to verify it yourself
On the target hardware, confirm the approved high-precision parent, the pinned quant command and output digest, and task, critical, memory, and p95 results relative to the reference.
To summarize this sectionRecord the exact source·quantizer·imatrix·tensor overrides rather than Q4·Q5 names, choose candidates with the same task·critical·performance gates, and avoid requantizing.
Conceptual explanation 08

Review an Ollama Modelfile as a package source containing template·parameter·license

The Ollama Modelfile reference defines FROM as the required base instruction, which can point to a supported safetensors directory or a GGUF file, and provides ADAPTER, TEMPLATE, SYSTEM, PARAMETER, and LICENSE. The import documentation warns that safetensors·GGUF adapters must use the same base used for fine-tuning as FROM. Check supported architectures and quant·adapter paths for each Ollama version before release.

TEMPLATE serializes roles and content into actual control tokens, and stop parameters change generation termination. Compare golden conversations from training and reference runs with Ollama prompts and token dumps. Adding SYSTEM or MESSAGE changes behavior, so evaluate it as a separate prompt candidate rather than convenience metadata. Pin defaults such as num_ctx, temperature, and top_k, and the request-override policy in the manifest.

The LICENSE instruction packages the model's license text; it does not replace legal or owner review. Connect base, adapter, dataset, merge and quantization licenses and the model card's intended/out-of-scope uses to the release decision. A public push is a state change requiring separate external-publication authorization; local package validation does not automatically authorize it.

After Create, export actual Modelfile, manifest, and blob digests and compare intended source digests, templates, and parameters. Repeat build, pull, and run on a clean host, logging resolved digests rather than package names or tags. Even if a registry alias points to the candidate digest, test restart and eviction with the same failing input to check whether workers still use cached old blobs.

Why does this happen?
Because an Ollama package combines weights with prompt serialization·generation defaults, final behavior can differ even when the upstream GGUF alone passes.
When is it a problem?
If you check only Create success and the package name, you discover a wrong base adapter, template or stop mismatches, and mutable tag drift in production.
Common beginner misconceptions
A single LICENSE or SYSTEM line in a Modelfile does not automatically establish actual redistribution rights·quality approval or identity with the training template.
How to verify it yourself
Check the resolved FROM/ADAPTER digest, golden TEMPLATE·stop·parameters, the license decision, and the clean build·actual worker digest.
To summarize this sectionTo explain package behavior, matching FROM and ADAPTER is not enough: compare TEMPLATE, stop, SYSTEM, num_ctx and the resolved blob against the training/reference contract.
Conceptual explanation 09

Close the artifact release with registry·canary and full lineage rollback

Distinguish registry states such as quarantine, verified-input, candidate, approved, and revoked. A candidate record holds digest·size·format, parent graph, build provenance, file inventory·scanner, license decision, evaluation·limitations, owner·review date, and supported runtimes. Finishing an artifact upload does not automatically move the approved alias. Promote atomically only after every independent gate and approver has confirmed, and keep an audit log.

On an offline release set, compare base/dynamic adapter, merged weights, high-precision GGUF, quantized artifacts, and packages using the same template·decoding·runtime. Pass format·identity, task·critical·general, p95·memory, and fresh-load gates at every edge. Replay builds several times to explain expected deterministic digests or permitted metadata differences. Include corrupt downloads·digest mismatches and missing tokenizers as negative tests.

In a limited canary, check that the actual production endpoint uses the expected blob, template, and parameters, and observe schema and critical incidents, human corrections, p95, memory, and load errors. Apply predefined stop conditions instead of simply filling a quota of canary traffic or time. Register unexpected digests, license expiry, source revocation, runtime CVEs, model defects, and template changes as re-review triggers.

Rollback is not an alias edit: restore previous compatible base/adapter or merged·GGUF artifacts, tokenizer/template, Modelfile parameters, and runtime config·caches. Test candidate-failing inputs and normal regression sets several times within the recovery target. Inventory workers·caches·download mirrors for revoked digests, and record incident root causes, affected downstream nodes, and rebuild decisions.

Why does this happen?
Artifact defects spread to registries, caches, and workers, and replacing a single file may not restore compatible behavior.
When is it a problem?
Keeping only the previous GGUF while losing the template·runtime·adapter graph can leave the same error after rollback or introduce a new incompatibility.
Common beginner misconceptions
An immutable registry and a canary do not automatically make a release safe without quality and license review or an actual rollback drill.
How to verify it yourself
Repeatedly verify every gate in the approved record, the actual worker digest, and the failure set, normal set, and recovery time under a rollback to the previous full graph.
To summarize this sectionA deployment becomes a reversible change only when each artifact is promoted to an immutable registry state and the offline·canary evidence and recovery to the previous compatible package are actually repeated.

CONCRETE CASES

Check concepts in different situations

Before memorizing definitions, compare how these concepts appear on a personal PC and in real work.

  1. Case 1 · Define an artifact as a transformable dependency graph, not a single file

    Configure the registry so the Adapter v3 manifest links to base commit A, tokenizer/template B, and dataset and training run C, and records the SHA-256 and evaluation report at every edge of merge D→BF16 GGUF E→Q4_K_M F→Ollama manifest G.

    Key points to check here: Use immutable revisions·SHA-256 digests as identifiers instead of mutable names·folders and “final” filenames.
  2. Case 2 · Distinguish the risks that safetensors·pickle and hash·signature address

    Pin the Hub's full commit, download the safetensors, config, and tokenizer in isolation, and check the allowlist, sizes, and SHA-256 hashes against the manifest. Then inspect keys, shapes, and dtypes in a fresh restricted process, and keep the files in registry quarantine until approved.

    Key points to check here: Untrusted pickles are not deserialized in the production process, even if scan results are clean.
  3. Case 3 · Approve adapter loading and merging using the exact base and before-and-after merge evaluations

    Compare a reference that dynamically loads adapter A onto base commit B with merge_and_unload output C on the same template and frozen set; after C passes task 94%, critical 97%, the logit/behavior tolerance, and latency, approve C as the conversion source.

    Key points to check here: Check the adapter_model and adapter_config keys, base reference, revision, and targets in a fresh process.
  4. Case 4 · Create quantization candidates from a high-precision GGUF and verify metadata, template, and quality

    Convert merged BF16 safetensors digest A to F16/BF16 GGUF B with a pinned llama.cpp converter. Verify tensors·metadata and reference quality, then directly create Q4_K_M C and Q5_K_M D from B and compare quality·p95·peak on the same 100 cases.

    Key points to check here: Requantizing an already quantized file can increase quality loss, so verify the high-precision source in the lineage.
  5. Case 5 · Close deployment with Ollama package·registry·canary and full lineage rollback

    Create the package FROM the approved Q5 GGUF digest with a pinned template, stop tokens, num_ctx, and license record, export the resolved blob SHA-256, pass 3 identical clean builds, frozen evaluation, the 3900-token boundary, and a 10-minute rollback, and then move the alias to the new digest.

    Key points to check here: Check that the FROM base exactly matches the ADAPTER training base, and do not use a mutable tag as the approved identity.

CHAPTER 1 / 5

Define an artifact as a transformable dependency graph, not a single file

A model artifact is not simply a weight file stored on disk. It is a deployment unit that combines the tensors and config needed to run, the tokenizer·chat template, the adapter·base relationship, the runtime package, and generation settings. A PEFT adapter holds only a small update and requires the exact base, a merged model includes the entire base, and GGUF holds inference tensors and metadata. An Ollama package rebundles the FROM source with TEMPLATE·PARAMETER·SYSTEM·ADAPTER. Under the same model name, behavior and license scope can differ.

Nodes in an artifact graph are identified by content digest, and edges describe which tool, version, command, and config transformed an input digest into an output digest. “model-final-v2.gguf” keeps the same name even when its contents are replaced, but its SHA-256 changes whenever a byte changes. Use a registry alias only as a convenience name that points to an approved digest, and pin the digest in production. Record file size, hash, media type, and creation and review times to detect partial uploads and corruption.

Dependencies include more than weights. The base config, tokenizer, special tokens, chat template, adapter_config, quant recipe and importance matrix, Modelfile, runtime and converter commits, and evaluation manifest all have an effect. Also link the source model license and acceptable use, adapter data rights, and merge and redistribution terms to the edges. Distinguish the fact that license text was included in the package from a decision that reviewed actual usage and redistribution rights.

The SLSA provenance specification describes how an artifact was produced so consumers can verify that it is the expected build and rebuild it. It defines the buildDefinition and runDetails structures. Without claiming that this directly certifies model conversion, apply its principles by recording external parameters, resolved dependency digests, builder identity, invocation, and output subjects. If the conversion script is run manually on a local machine, state who ran it, in what environment, and the limits of reproducibility.

A large model may consist of multiple files, such as safetensors shards and an index JSON, split GGUF files or a vision projector. Define the bundle digest using a sorted manifest of each file’s path, size and SHA-256, plus the manifest’s own digest. Upload everything into a temporary namespace, pass server-side hash and fresh-load checks, then atomically publish the manifest pointer so consumers never see a partial shard upload. For deletion, separate hiding aliases from deleting underlying blobs, and check running workers, rollback retention and legal holds.

Separate repository states such as quarantine, input validation, release candidate, approval and revocation, and define who may change each state and what evidence is required. Developers may upload candidates but must not move production aliases themselves; reviewers approve after checking source lineage, quality and rights reports. Production servers have only approved read access and must not upload or overwrite arbitrary files. Audit state changes, downloads and deletions with the actor, time and target digest. When removing expired candidates, use a reference graph to preserve parents of approved artifacts and previous versions needed for actual recovery.

A figure showing the artifact dependency graph from adapter v3 through merged safetensors, GGUF F16, Q4_K_M GGUF and the Ollama package, with the size and sha256 of each node next to the tool, config, evaluation and license evidence left by every conversion edge
How to read the figure Two files can share a name and still differ in SHA-256 as soon as a byte changes. Nodes are identified by content digest, and every edge records the tool, parameters, environment, evaluation and license decision, so provenance and the rollback path live in the same graph.

To recap the key points

  • Use immutable revisions·SHA-256 digests as identifiers instead of mutable names·folders and “final” filenames.
  • Record each transformation's source·parameters·environment·output·evaluation and license decision as an independent build record.

How this connects in practice

Configure the registry so the Adapter v3 manifest links to base commit A, tokenizer/template B, and dataset and training run C, and records the SHA-256 and evaluation report at every edge of merge D→BF16 GGUF E→Q4_K_M F→Ollama manifest G.

To summarize this chapterAdapters, merged models, GGUF files, and Ollama packages are nodes with different purposes and dependencies; explaining identical behavior and recovery paths requires linking the exact base, tokenizer/template, tool, config, and source digests to each output digest.

CHAPTER 2 / 5

Distinguish the risks that safetensors·pickle and hash·signature address

Python pickle opcodes can import and execute code while restoring objects. Hugging Face’s pickle-security documentation warns of arbitrary-code-execution attacks and that scanners are best-effort, not 100% foolproof. Do not assume Pytorch_model.bin, .pt, .pth, or merely renamed files are trustworthy tensor containers. Avoid unknown or unnecessary sources and prefer compatible safetensors.

The official Safetensors documentation describes a simple format for storing tensors safely and quickly compared with pickle. It handles tensor keys, dtypes, shapes, and byte ranges; model cards, code, and tokenizers are separate files. Safetensors does not eliminate malicious values, oversized tensors, NaNs, incorrect architectures or licenses, or backdoor behavior. Pin the parser version and check header and file sizes, allowed dtypes, keys, and shapes, and resource limits before loading.

For Hub downloads, use a full commit-hash revision instead of the default latest main. The official Hub documentation explains that you can download by full-length commit, that a version-aware cache path is returned, and that cache files should not be modified directly. Define the allow patterns needed from the repository snapshot, and inventory any unexpected executables, pickle files, or custom code. Store the download URL, repo type, commit, file list and sizes, and SHA-256 hashes as release inputs.

Hashes and signatures answer different questions. A SHA-256 digest checks whether local bytes match those referenced by the registry manifest, but does not establish whether the initial manifest is trustworthy. A signature/attestation can verify that an approved builder or identity produced provenance for a particular subject digest, but requires signer keys, policy, transparency and build isolation. Use safe formats, digests, provenance, malware scanning and behavioral evaluation as complementary layers of defense, not substitutes for one another.

Before extraction, artifact intake limits archive entry count, total expanded size, nesting depth, and paths, and rejects symbolic links, absolute paths, and parent-directory traversal. Download services and inspection workers must not share production secrets or home caches. Use read-only sources, limited CPU, memory and time, and a fresh output directory. Scan failures and timeouts mean an inconclusive hold, not “no problems.” Link inspection logs to input digests and scanner signatures and versions so affected artifacts can be found again when rules change.

Do not connect service API keys, the user’s home directory, or the production model cache to the inspection environment. If conversion requires authentication, grant only read-only, short-lived credentials scoped to that job. Mask tokens·internal paths in standard output·error and provenance. Combine string·entropy rules with human review to check settings·model cards·templates inside outputs for accidentally included secrets, personal identifiers, and internal addresses. When a secret is found, do not stop at masking the file: immediately revoke·rotate it, revoke all downstream digests derived from those bytes, and rebuild from clean input.

To recap the key points

  • Untrusted pickles are not deserialized in the production process, even if scan results are clean.
  • A digest shows that the received bytes are identical; signatures and provenance are a separate layer that verifies who built the artifact and with which build.

How this connects in practice

Pin the Hub's full commit, download the safetensors, config, and tokenizer in isolation, and check the allowlist, sizes, and SHA-256 hashes against the manifest. Then inspect keys, shapes, and dtypes in a fresh restricted process, and keep the files in registry quarantine until approved.

To summarize this chapterSafetensors is designed to store tensors more safely than pickle, but format safety does not guarantee source trust, content integrity, quality, or licensing. Combine pinned downloads, digest checks, quarantine, and separate review.

CHAPTER 3 / 5

Approve adapter loading and merging using the exact base and before-and-after merge evaluations

The official PEFT checkpoint documentation describes the adapter_model.safetensors and adapter_config.json produced by save_pretrained, and states that the state_dict contains only adapter parameters and not the base model. An adapter file alone is therefore not an independent model. Because base_model_name_or_path·revision in the config may be empty or mutable, compare it against the exact base hash in the training manifest. Also check that target module·rank·alpha·modules_to_save and changed tokenizer files match the checkpoint keys·shapes.

Dynamic adapter loading supports several tasks through small files and a shared base, but the runtime must support the architecture, adapter method, and quant combination. A wrong base whose shapes happen to match can load without errors while corrupting behavior. In a fresh environment, load the exact base, compare golden template tokens, base-only/adapter-on/adapter-disabled outputs, and frozen evaluation, and expose adapter identity by cache and worker.

Merge is a conversion that folds adapter updates into the base weights and saves the result as a regular model. The PEFT documentation explains that after a merge, PEFT-specific features are lost, unmerge·multiple adapters·disable become difficult, and some method·quant settings do not support merge. Record the merge input precision, device·dtype, and tool version. Do not merge unconditionally into a quantized base or use an already quantized community file as the source; confirm the officially supported path for the approved high-precision base·adapter combination.

A successful merge log does not guarantee numerical or behavioral identity. Compare the base+dynamic-adapter reference with merged output using the same tokenizer/template·decoding·frozen task·critical·general sets, recording tensor keys·shapes·NaN, logit tolerances, and output differences. Merged weights contain the entire base, so review storage·distribution licenses and access classes again. Preserve the original base·adapter in an immutable registry for regeneration·rollback if a merge defect appears.

To recap the key points

  • Check the adapter_model and adapter_config keys, base reference, revision, and targets in a fresh process.
  • Merge preserves the original adapter·base so the change can be reversed, and assigns the merged output a new digest·license·evaluation.

How this connects in practice

Compare a reference that dynamically loads adapter A onto base commit B with merge_and_unload output C on the same template and frozen set; after C passes task 94%, critical 97%, the logit/behavior tolerance, and latency, approve C as the conversion source.

To summarize this chapterA PEFT adapter does not include base weights, so build dynamic load and merge as separate artifacts, verify the exact base·target·tokenizer, and measure logits·task·critical·operational differences before and after the merge.

CHAPTER 4 / 5

Create quantization candidates from a high-precision GGUF and verify metadata, template, and quality

The GGUF specification defines headers, key-value metadata, tensor information and aligned tensor data. Standardized keys include general.architecture, quantization_version, alignment and model name, version and base metadata; quantization and optimization differences must be recorded in metadata or architecture definitions. A .gguf extension does not guarantee correct architecture, tokenizer, chat template or tensors. Use official parsers and information tools to inspect magic/version, tensor count, type, offset and metadata.

The converter maps the source architecture, config, tokenizer, and tensor names to the GGUF schema. Pin the llama.cpp commit and record the convert command, Python dependencies, source digest, output log, and hash. Do not let an unsupported custom model or a missing tokenizer pretokenizer pass by ignoring warnings. First evaluate the high-precision GGUF with the same prompts and template as the source safetensors reference to separate conversion-mapping problems from quant loss.

The official llama.cpp quantization documentation describes using llama-quantize to turn high-quality GGUF input into formats such as Q4_K_M, and explains that quantization changes size and inference speed but may reduce accuracy. It warns that requantization may degrade quality significantly compared with quantizing directly from 16-bit or 32-bit input. Record quantization type, imatrix source and hash, tensor overrides, and options such as keep-split in the manifest. Do not infer the recipe from a community filename alone.

Candidate gates extend beyond parsing, loading and generating one sentence. Compare high-precision references and Q4/Q5 using the same frozen task, critical, format and long-context sets, tokenizer/template and decoding settings. Measure file size, peak memory, prompt-processing and generation throughput, first-token latency, p95 and target-hardware operators. Define acceptable quality loss, memory savings and latency before seeing results. Choose the artifact passing every essential gate, not merely the smallest file.

Multimodal models may need companion artifacts such as projector·processor config·image normalization in addition to text GGUF; embedding models require pooling·normalization contracts. Do not hash only the main weights and mark the bundle complete. Test fail-closed behavior with normal·missing·incorrect companion fixtures, and maintain a supported-runtime·minimum-version matrix for each architecture feature. For split GGUF, verify shard order·count and every digest. Do not automatically fetch an arbitrary latest shard from the network when one is missing.

To recap the key points

  • Requantizing an already quantized file can increase quality loss, so verify the high-precision source in the lineage.
  • Conversion and quantization each produce a new artifact that must pass parse, load, generation, task, critical, and performance gates.

How this connects in practice

Convert merged BF16 safetensors digest A to F16/BF16 GGUF B with a pinned llama.cpp converter. Verify tensors·metadata and reference quality, then directly create Q4_K_M C and Q5_K_M D from B and compare quality·p95·peak on the same 100 cases.

To summarize this chapterGGUF is an inference format that holds tensors and standardized metadata. Check converter and architecture support and the chat template, quantize directly from an approved high-precision source, and re-evaluate quality, memory, and latency for each candidate.

CHAPTER 5 / 5

Close deployment with Ollama package·registry·canary and full lineage rollback

Ollama’s Modelfile documentation defines FROM as the required base instruction, permits GGUF files·supported safetensors directories as sources, and provides TEMPLATE·PARAMETER·SYSTEM·ADAPTER and LICENSE. The import documentation warns that an adapter’s FROM must be the same base used in fine-tuning; otherwise behavior may be erratic. Check supported architectures·quant methods in the current version and do not assume a QLoRA adapter is directly compatible.

Templates and stop tokens are part of model behavior. Render golden conversations from training and the reference runtime using Ollama TEMPLATE, and compare control tokens, system/user/assistant roles, and stop behavior. PARAMETER settings such as num_ctx and temperature are package defaults; record the request-override policy too. Adding SYSTEM or MESSAGE for convenience changes adapter-evaluation inputs, so assess it as a new behavior candidate. The LICENSE instruction records license text; it does not itself approve redistribution.

After Create succeeds, use `ollama show --modelfile` and similar outputs to collect resolved configuration and blob digests, then compare intended source, template, and parameters. Repeat package builds on a clean host with identical locked inputs; investigate nondeterministic metadata and builder differences if digests change. Registry records should contain source graphs, build provenance, SBOM-like file inventories, quality/performance reports, owners, limitations, expiry, and approved environments. Move aliases atomically to reviewed digests.

After offline gates, observe actual endpoint schema·critical failures, p95·memory, model/template identity, and human corrections in shadow·limited canary. Rollback is not merely changing an Ollama alias; it means restoring the previous compatible model blob, adapter·template·parameters·runtime config and cache·workers, then confirming recovery from the candidate failure. Practice digest mismatch·corrupt download·unsupported runtime·quality regression incidents, and record recovery time·owner·re-review triggers in the evidence.

For sites without external Hub access, deliver approved bundle manifests, blobs, signatures/provenance and license snapshots through offline media or internal mirrors. Recalculate digests before and after mirror import and do not rewrite mutable tags. Disaster recovery must restore actual large blobs, encryption keys, verification policies and previous runtime images to a new host and run frozen evaluations, not just back up registry metadata. For source revocation, license changes or security defects, query all downstream merges, GGUFs and packages from affected parents and block aliases, evict workers, rebuild or retire artifacts.

A recovery drill must be an actual run that retrieves and validates the previously approved version on new hardware and brings the service up, not a document-only review. Test whether startup can proceed from an approved local copy while the repository is unavailable, who restores the signature verification policy and encryption keys, and from which source a damaged piece is fetched again. Operators check the running digest, template revision, and settings rather than the model name on screen, and record whether failing inputs and the normal regression set recover within the target time. Feed gaps found in drills into parent retention, backups, permissions, and automated checks before the next incident.

Gate table that lists, for each of four stages (merge, GGUF F16 conversion, Q4·Q5 quantization, and Ollama packaging), the checks only that stage reveals, pass criteria written as actual values, and the approved digest to return to on failure
How to read the figure A log saying the conversion succeeded is not a gate. Evaluate each stage's output as a new candidate, and on failure actually roll back to an earlier approved digest such as the merged safetensors or the F16 GGUF.

To recap the key points

  • Check that the FROM base exactly matches the ADAPTER training base, and do not use a mutable tag as the approved identity.
  • A package name is an alias; observe the blob digest·template·parameters actually loaded by production nodes.

How this connects in practice

Create the package FROM the approved Q5 GGUF digest with a pinned template, stop tokens, num_ctx, and license record, export the resolved blob SHA-256, pass 3 identical clean builds, frozen evaluation, the 3900-token boundary, and a 10-minute rollback, and then move the alias to the new digest.

To summarize this chapterBind the Modelfile's FROM·ADAPTER·TEMPLATE·SYSTEM·PARAMETER and LICENSE to source digests·evaluation, verify the actual resolved manifest after package create, and promote through an immutable registry·canary·rollback to the previous full package.

INTERACTIVE LAB 1 / 2

Lab 1 · Artifact provenance and safe format contract lab

Enter values in the browser and check the execution results and the failure and recovery paths. No commands are ever sent to real equipment or the NAS.

Approve artifact type, safe format, immutable source, and provenance manifest

Assess the parent graph, full revisions, output digests, quarantine, rights and build evidence rather than filenames and extensions. The defaults deliberately fail.

Situation
model-final.pkl was downloaded from the latest base and the file seems likely to open, but there is no way to tell which base·tool·license the bytes came from.
Goal
Complete the expected format, immutable source and digest, dependencies, inventory, safe load, license, and provenance for one Adapter, merged, GGUF, or Ollama node.
Prerequisites
Prepare the full source commit, parent artifact digests, file inventory and SHA-256 hashes, pinned build record, and actual license decision.
Success criteria
Enter a safe format for the node and a valid full revision·SHA-256, and all five pieces of evidence are confirmed.
  1. Select the artifact node to add to the registry and the actual data format.
  2. Enter the full source revision and output SHA-256 rather than a mutable tag, and verify dependency·quarantine·rights·build evidence.
  3. Run the artifact manifest gate Then, instead of renaming the file, strengthen the failed source, format, or evidence layer and rerun.

Evidence limits: The browser evaluates only text patterns and checkboxes; it does not actually verify file headers, hashes, signatures, tensors, licenses, or provenance. Raw inventories, digest commands, attestations, and reviewer decisions are the final evidence.

INTERACTIVE LAB 2 / 2

Lab 2 · Conversion quality, package, and rollback promotion lab

Enter values in the browser and check the execution results and the failure and recovery paths. No commands are ever sent to real equipment or the NAS.

Promote an artifact on conversion quality, template, resources, clean package, and rollback

Judge end-to-end behavior and deployable identity against the approved parent, rather than merge·GGUF·quant·Ollama create success or file size. Defaults intentionally fail.

Situation
The Q4 Ollama package was small and create succeeded, but critical output·template compliance dropped, p95 was slower, and which previous blob to return to was not confirmed.
Goal
Combine task, critical, and template checks, p95 and memory, clean builds, edge failures, fresh packages, and full-lineage rollback into one release gate.
Prerequisites
Prepare an approved dynamic/high-precision reference, the same frozen set and runtime, parent/output digests and build logs, a fresh host, and the previous complete package.
Success criteria
All five metrics and 3 clean builds pass, and reference, edge, fresh package, and full rollback evidence is confirmed.
  1. Before seeing candidate results, pin the task, critical, template, p95, and memory-savings criteria.
  2. Enter measurements taken under the same conditions as the approved parent, the number of clean builds, edge review, the fresh package, and rollback evidence.
  3. Run the artifact promotion gate Then fix the source, converter, quantization or package at the failed edge and reevaluate with a new digest, without lowering thresholds.

Evidence limits: The browser evaluates only the entered numbers; it does not run merge, converter, quantizer, Ollama, or registry operations or measure latency. Actual artifact bytes, raw evaluation, build provenance, resolved worker digests, and rollback logs are required.

KEY TERMS

Key terms in this unit

Artifact lineage
Dependencies and conversion history linking exact source weights and configuration through adapter, merge, conversion and quantization to the package output digest
Safetensors
A data format designed, unlike Pickle, for safe and fast tensor storage; it does not itself guarantee source provenance·quality·license
GGUF
An inference file format in the llama.cpp family that holds key-value metadata, such as architecture and tokenizer, together with tensor information
Content digest
A value computed by hashing file bytes to compare immutable artifact identity and transfer integrity
Provenance
Evidence describing the inputs, parameters, builder, and execution that produced an artifact, so that consumers can verify and rebuild it

UNIT WORKBOOK

Exercises and worksheets for applying concepts to new situations

Start by checking basic principles, then expand to practical workplace decisions. After submitting an answer, you can see why every option is correct or incorrect, not just the correct answer.

Basic Question 1

Which statement most accurately distinguishes the problems that safetensors and a SHA-256 digest each solve?

Choose an answer
Basic Question 2

What is the most complete bundle needed to reproduce the PEFT LoRA adapter in a different environment?

Choose an answer
Apply Question 3

A Q4 GGUF built from merged safetensors shows a large drop in task quality. Which procedure best isolates the cause?

So far, only the source merged model and Q4 have been compared; high-precision GGUF has not been evaluated.

Choose an answer
Apply Question 4

Ollama created an adapter package, but the answer format differs from the training reference. Which contract should be checked first?

Choose an answer
Capstone Question 5

Which is the most complete plan for promoting an Adapter→merge→GGUF→Ollama candidate to production?

The essential gates are 92% task quality, 98% critical, 99% template, p95 of 1200ms, 30% memory reduction, and recovery of the previous full package.

Choose an answer

PERSONAL WORKSHEET

A learning worksheet you adapt to your own environment

Your input remains only on the current browser screen and is not stored or transmitted externally. Use categories and pseudonyms instead of actual sensitive information.

OFFICIAL SOURCES

Verify against official sources

Technical, compatibility, and model information reviewed: August 2026

LEARNING RECORD

Complete the integrated course once here

3 core units: read the text, exercises, and answer explanations thoroughly before recording your learning status.

SHARE & IMPROVE

Knowledge we verify together, shared back with everyone

If you have questions, suggestions, or training materials to share, please send them. We will review them and incorporate them into the courses.