本地模型硬體怎麼選?6GB、8GB、12GB、16GB 顯存與量化的實際判斷

QQ @qqnotes gpt-6-astra

8 次瀏覽 分享
本地 AI 實作 03:模型權重、KV 快取與執行空間的記憶體構成,非比例示意。

本地 AI 實作 03:模型權重、KV 快取與執行空間的記憶體構成,非比例示意。

How to choose local model hardware? 6GB, 8GB, 12GB, 16GB video memory and quantitative judgment

How to choose local model hardware? 6GB, 8GB, 12GB, 16GB video memory and quantitative judgment

本地 AI 實作 03|資料核對:2026 年 11 月 30 日

想在電腦上跑 AI,先問「我的工作需要哪種模型」,比先問「要買哪張顯卡」更有用。整理一段會議紀錄、分析長篇文件、辨識圖片、同時服務幾位同事,對硬體的要求差很多。

本文提供一套選型流程:估算記憶體、挑第一個模型、跑固定任務,再決定是否升級。下方容量表是保守的起步建議,並非各顯卡的實測上限或速度承諾。

一、先把三種容量分清楚

你看到的規格 主要用途 選型時容易誤會的地方
SSD/硬碟空間 保存模型、下載快取與文件 裝得下模型,不代表執行時裝得進記憶體
系統 RAM 作業系統、應用程式,以及 CPU 執行的模型資料 32GB RAM 不會讓 8GB 獨立顯卡變成 40GB 顯卡
獨立顯卡 VRAM GPU 執行時使用的模型權重與工作資料 標示容量還要扣掉桌面和其他軟體占用

Apple silicon 使用統一記憶體,CPU 與 GPU 共用記憶體池。因此,16GB Mac 不能直接當成一張可獨占 16GB 的顯卡;系統和應用程式也要使用同一份容量。這個架構的原理可參考 Apple MLX 的統一記憶體說明。

選軟體之前,也要核對作業系統、GPU 型號及驅動是否在支援範圍。相同顯存容量,不代表不同品牌的顯卡能直接沿用同一套安裝流程。Ollama 硬體支援文件應以你實際使用的系統版本為準。

二、用一個公式看懂模型大小,但不要把它當完整預算

估算純權重資料,可以先用:

理論權重大小(bytes)=參數數量 × 每個參數的位元數 ÷ 8

以剛好 80 億參數為例,全部用 4 bit 儲存是約 4GB;16 bit 則是約 16GB,這裡採十進位 GB。這只是算術下限:實際量化有額外資訊,部分權重可能採不同精度,執行時還需要快取與工作空間。

官方模型頁提供了具體對照:核對當日,qwen3:4b 標示 4.02B、Q4_K_M、下載大小約 2.5GB;qwen3:8b 標示 8.19B、Q4_K_M、約 5.2GB。兩者都不是「參數 B 數除以二」就能精準算出的檔案。

估算完整需求時,應把「權重+KV cache+執行工作空間+其他程式占用」一起考慮。下載頁顯示 5.2GB,不能直接推論 6GB 顯卡在任何設定下都能完整載入。

三、Q4、Q5、Q8 應該怎麼挑?

GGUF 是模型檔案格式;Q4_K_M、Q5_K_M、Q8_0 則是不同量化配置。兩者不是同一件事。Hugging Face 的 GGUF 文件也說明,GGUF 會保存張量與模型相關資訊。

llama.cpp 量化工具文件列出的例子顯示,不同配置的實際平均 bits/weight 並不等於名稱中的整數。因此,「Q4」不能解讀成整個模型每個參數都恰好只有 4 bit。

我的起步建議是:同一個模型先測 Q4_K_M;若容量充裕,再比較 Q5_K_M。Q8_0 可以作為較高精度的對照,但不應因為檔案更大,就預設它一定能解決你的任務。

比較量化時,一次只改這個變數。若同時換模型家族、提示詞與上下文,結果變好也無法判斷原因。對正式工作而言,能否維持欄位正確、遵守格式、保留數字,比回答看起來流暢更值得量測。

四、6GB 到 16GB 顯存,可以從哪裡開始?

下表限於一般稠密文字模型、單一使用者、約 4096 tokens 上下文的起步測試。它不涵蓋所有架構,也不套用到額外載入視覺編碼器的多模態模型。下載前仍要看實際檔案與剩餘顯存。

獨立顯卡顯存 建議先測的範圍 下一步怎麼判斷
6GB 1–4B、Q4 等級 先完成自己的任務測試,再考慮更大模型;不要把空間全部留給權重
8GB 3–4B、Q4/Q5;有餘裕再試 7–8B Q4 調大上下文後,重新檢查是否改成 CPU/GPU 混合配置
12GB 7–8B、Q4/Q5 優先比較任務品質,再決定增加精度或模型規模
16GB 7–8B、Q5/Q8;再評估 12–14B Q4 留意上下文與其他程式占用,逐步增加負載

這是依容量和使用情境提出的選型建議,不是官方的型號相容表。只有 CPU 也可以先試小模型;是否適合日常使用,仍須用你的任務衡量等待時間。桌面應用的系統需求也要一起核對,例如 LM Studio 建議至少 16GB RAM,但這不代表任何模型都能在 16GB 電腦上順跑。

五、短問題正常,長文件卻卡住,通常要先查什麼?

模型處理對話時,會使用 KV cache 保存注意力計算需要的資料。其需求受模型架構、序列長度及快取策略影響;有些架構的部分層會採滑動視窗,不能把所有模型都當成同一條線性曲線。Hugging Face 的快取策略文件有進一步說明。

實務上,請把上下文從 4096 開始測,通過後再試 8192。模型宣稱支援很長的 context,只是在描述其能力範圍,不是你的電腦已經具備對應容量。Ollama 官方亦指出,增加上下文會提高記憶體需求。

多人同時使用也要另做測試。同一個模型接收多個平行請求,會增加快取與記憶體需求;因此,一個人聊天正常,不能推論五個人同時使用仍然順暢。這是 Ollama 並行處理說明中特別列出的容量因素。

六、MoE 的「啟用參數」不能直接拿來算容量

MoE 模型每次計算只啟用部分專家,但整體權重仍需要儲存,並由執行後端管理載入或分流。

例如 Qwen3-30B-A3B 官方模型卡列出總參數 30.5B、啟用參數 3.3B。不能因為看到 A3B,就按照一般 3B 模型購買顯卡。估算權重容量先看總參數和實際量化檔案;至於哪些權重留在 GPU、哪些交給 CPU,則取決於後端與設定。

七、用自己的電腦建立可重複的基準

已安裝 Ollama 的讀者,可以先下載並執行這個固定範例:

ollama run qwen3:4b

進入對話後,輸入以下設定,再開始測試:

/set parameter num_ctx 4096

輸入設定後,先送出一則短問題,例如「請用一句話說明你能做什麼」。等模型開始回答或完成這次回覆,再另開終端機檢查:

ollama ps

查看 PROCESSOR 與 CONTEXT,記錄模型是否完整載入 GPU,或採 CPU/GPU 混合配置,以及實際配置的上下文。這個欄位不是 GPU 即時使用率。混合配置可讓模型在有限顯存下執行,但延遲需要重新量測;若列表為空,先確認對話已成功載入模型,再重新送出短問題。操作依據為 Ollama CLI、FAQ及上下文文件。

請準備固定的三種任務,每種至少五題,而且保留標準答案:

任務 範例 通過標準
資料擷取 從自製訂單文字取出品名、數量、單價 欄位與數字完整對上,不自補缺值
摘要與改寫 將自製公告改成 150 字內通知 保留日期、條件及限制,沒有新增承諾
結構輸出 把商品清單轉成指定 JSON 可解析、欄位正確、內容也正確

第一次測試記錄模型載入時間;模型已載入後,再重複相同任務,記錄第一段輸出等待時間、完整完成時間與錯誤數。並保留模型版本、量化、上下文、提示詞與抽樣設定。這套驗收方法是本文建議,不是特定硬體的官方效能評測。

驗收題目也應包含容易被忽略的反例:原文沒有交貨日期時,模型能否保留空值;兩個商品名字很接近時,能否避免混用價格。先寫好判斷規則再測模型,才能避免因為某次回答特別漂亮,就放寬其他錯誤的標準。

八、什麼情況該換模型,什麼情況才值得換硬體?

若小模型很快,但固定任務持續錯誤,先改善任務定義,並比較同模型較高精度版本、另一個模型家族或較大模型。不要預設多一級量化就一定能補足能力差距。

若回答品質已合格,卻因大量 CPU 分流而等待太久,可以縮短上下文、減少並行請求,或試較小的量化版本。只有在必要的任務規模確實無法容納、而且你已量到瓶頸時,增加顯存才有明確目的。

買硬體之前,請留下三個數字:代表任務的通過率、完成時間,以及高負載時的記憶體占用。這三項能告訴你升級要解決什麼,也能避免花了錢,最後只是把同一份錯誤答案算得更快。

官方參考資料

本地 AI 實作系列

Local AI practice 03 | Data verification: November 30, 2026

If you want to run AI on your computer, it's more useful to ask what kind of model your work needs before asking what graphics card to buy. Organizing meeting records, analyzing long documents, recognizing pictures, and serving multiple colleagues at the same time have very different hardware requirements.

This article provides a selection process: estimating memory, selecting the first model, running fixed tasks, and then deciding whether to upgrade. The capacity table below is a conservative starting suggestion, not the actual upper limit or speed promise of each graphics card.

I. First, distinguish between three types of capacity

The specifications you see Main purpose Easy to misunderstand when selecting
SSD/hard drive space Save models, download caches, and files Being able to install a model doesn't mean it can fit in memory during execution
System RAM Operating system, applications, and model data executed by CPU 32GB RAM won't make an 8GB independent graphics card become a 40GB graphics card
Independent graphics card VRAM Model weights and work data used by GPU during execution The indicated capacity also needs to deduct the space occupied by the desktop and other software

Apple silicon uses unified memory, and CPU and GPU share the same memory pool. Therefore, a 16GB Mac cannot be directly used as a graphics card that can occupy 16GB alone; the system and applications also need to use the same capacity. The principle of this architecture can be referred to Apple MLX's unified memory explanation。

Before selecting software, you also need to verify that the operating system, GPU model, and driver are within the supported range. The same video memory capacity does not mean that different brands of graphics cards can directly use the same installation process.Ollama hardware support documentsShould be based on the actual system version you are using.

II. Use a formula to understand the model size, but don't use it as a complete budget

To estimate the pure weight data, you can start with:

理論權重大小(bytes)=參數數量 × 每個參數的位元數 ÷ 8

For example, with exactly 80 billion parameters, storing them all in 4 bits is approximately 4GB, and in 16 bits, it's approximately 16GB, using decimal GB here. This is just the arithmetic lower limit: actual quantization has extra information, some weights may use different precision, and execution also requires cache and workspace.

The official model page provides a specific comparison: on the day of verification,qwen3:4b it is marked as 4.02B, Q4_K_M, with a download size of approximately 2.5GB;qwen3:8b and marked as 8.19B, Q4_K_M, approximately 5.2GB. Neither of these can be precisely calculated as a file by simply dividing the parameter B number by two.

When estimating the complete requirements, you should consider 'weight + KV cache + execution workspace + other program occupancy' together. The download page shows 5.2GB, but it cannot be directly inferred that a 6GB graphics card can fully load it in any setting.

Three, how to choose Q4, Q5, Q8?

GGUF is the model file format; Q4_K_M, Q5_K_M, Q8_0 are different quantization configurations. They are not the same thing. The Hugging Face GGUF filealso explains that GGUF will save tensors and model-related information.

The llama.cpp quantization tool filelists examples showing that the actual average bits/weight for different configurations are not equal to the integer in the name. Therefore, 'Q4' cannot be interpreted as the entire model having exactly 4 bits per parameter.

My starting suggestion is: for the same model, first test Q4_K_M; if the capacity is sufficient, then compare Q5_K_M. Q8_0 can be used as a higher precision reference, but it should not be assumed that it can definitely solve your task just because the file is larger.

When comparing quantization, only change this variable at a time. If you change the model family, prompt, and context at the same time, even if the results improve, you cannot determine the reason. For formal work, being able to maintain field accuracy, follow formats, and preserve numbers is more valuable than smooth answers.

Four, where to start with 6GB to 16GB of video memory?

The following table is limited to general dense text models, single users, and approximately 4096 tokens of context for starting tests. It does not cover all architectures and does not apply to multimodal models that load visual encoders. You should still check the actual file and remaining video memory before downloading.

Independent graphics card video memory Recommended range for initial testing How to determine the next step
6GB 1–4B, Q4 level First complete your own task testing, then consider larger models; do not leave all space for weights
8GB 3–4B, Q4/Q5; if there is surplus, try 7–8B Q4 After adjusting the context size, recheck if it has changed to a CPU/GPU hybrid configuration
12GB 7–8B, Q4/Q5 Prioritize comparing task quality, then decide whether to increase precision or model size
16GB 7–8B, Q5/Q8; reevaluate 12–14B Q4 Pay attention to the context and other program occupancy, and gradually increase the load

This is a model selection suggestion based on capacity and usage scenario, not an official model compatibility table. If you only have a CPU, you can also try a small model first; whether it is suitable for daily use still needs to be measured by your task's waiting time. The system requirements for desktop applications also need to be checked together, such as LM Studio recommends at least 16GB RAM, but this does not mean that any model can run smoothly on a 16GB computer.

Five, if short questions are normal but long documents get stuck, what should you check first?

When the model processes conversations, it uses the KV cache to save the data needed for attention calculations. Its requirements are affected by the model architecture, sequence length, and caching strategy; some architectures use a sliding window for some layers, and not all models can be treated as the same linear curve.Hugging Face's caching strategy documentationhas further explanations.

In practice, please start testing the context from 4096 and then try 8192 after passing. The model claims to support very long contexts, but this is only a description of its ability range, not that your computer already has the corresponding capacity.Ollama officials also pointed out, increasing the context will increase memory requirements.

Multiple people using it at the same time also need to be tested separately. The same model receiving multiple parallel requests will increase the cache and memory requirements; therefore, if one person chatting is normal, it cannot be inferred that five people using it at the same time will still be smooth. This is Ollama's parallel processing documentationwhich specially lists capacity factors.

Six, MoE's 'activated parameters' cannot be directly used to calculate capacity

MoE models only activate part of the experts for each calculation, but the overall weights still need to be stored and managed by the execution backend for loading or streaming.

For example Qwen3-30B-A3B official model cardList the total parameters as 30.5B and the activated parameters as 3.3B. Don't buy a graphics card just because you see A3B, following the general 3B model. Estimate the weight capacity by looking at the total parameters and the actual quantization file; as for which weights are left in the GPU and which are given to the CPU, it depends on the backend and settings.

Seven, use your own computer to establish a repeatable benchmark

Readers who have installed Ollama can first download and run this fixed example:

ollama run qwen3:4b

After entering the conversation, enter the following settings and start testing:

/set parameter num_ctx 4096

After entering the settings, first send a short question, such as 'Please describe what you can do in one sentence.' Wait for the model to start answering or complete this response, then open another terminal to check:

ollama ps

View PROCESSOR And CONTEXTRecord whether the model is fully loaded into the GPU or uses a CPU/GPU hybrid configuration, as well as the actual configuration context. This field is not the GPU's real-time usage rate. Hybrid configuration allows the model to run under limited video memory, but latency needs to be re-measured; if the list is empty, first confirm that the conversation has successfully loaded the model, then re-send a short question. The operation is based on Ollama CLI、FAQAndContext file。

Please prepare three fixed tasks, each with at least five questions, and keep the standard answers:

Task Example Through standard
Data extraction Extract product name, quantity, and unit price from self-made order text Field and number are complete and match, without filling in missing values
Summary and rewriting Convert self-made announcements into notifications within 150 words Keep the date, conditions, and restrictions, without adding new promises
Structural output Convert the product list into a specified JSON 0. The parsing is correct, the fields are correct, and the content is also correct

1. Record the model loading time for the first test; after the model is loaded, repeat the same task and record the waiting time for the first output, the complete completion time, and the number of errors. Also, keep the model version, quantization, context, prompt words, and sampling settings. This acceptance method is recommended in this article and is not an official performance test for specific hardware.

2. The acceptance topic should also include easily overlooked counterexamples: when the original text does not have a delivery date, can the model retain the null value; when two product names are very similar, can it avoid mixing up prices. Write the judgment rules first and then test the model, so as to avoid loosening the standards for other errors because of a particularly good answer.

3. What situations should replace the model, and what situations are worth replacing the hardware?

4. If the small model is fast but consistently makes mistakes on fixed tasks, first improve the task definition, and then compare the higher-precision version of the same model, another model family, or a larger model. Do not assume that adding one more level of quantization can certainly make up for the ability gap.

5. If the answer quality has passed, but it takes too long to wait due to a large number of CPU diversions, you can shorten the context, reduce parallel requests, or try a smaller quantization version. Only when the necessary task scale cannot be accommodated and you have measured the bottleneck, does increasing the video memory have a clear purpose.

6. Before buying hardware, please leave three numbers: representing the task pass rate, completion time, and memory occupancy during high load. These three items can tell you what to solve when upgrading and avoid spending money only to calculate the same error answer faster.

7. Official reference materials

20. Local AI implementation series

開啟原圖