aifree.dev

Vì sao mô hình 7B cần 16 GB RAM?

Bộ nhớ của mô hình: số tham số × số byte, cộng KV cache · Cơ bản · 5 phút · llm, context · học sau Open weights vs closed API models, and model licenses Tiếng Anh, Lượng tử hoá (quantization, số bit mỗi trọng số), Context window

Mô hình phải giữ mọi trọng số trong bộ nhớ: số tham số × số byte mỗi tham số, cộng một KV cache lớn dần theo ngữ cảnh. Mô hình 7B cần khoảng 14 GB ở 16 bit và 4–5 GB ở 4 bit.

Trước khi bắt đầu: bạn giải thích được chuyện này cho bạn bè không?

1 = hoàn toàn không · 5 = dễ dàng

  1. 1 Đoán trước

    Qwen2.5 7B có 7,6 tỷ tham số. Bản tải đầy đủ độ chính xác (16 bit) nặng bao nhiêu?
  2. 2 Xem

    Where the gigabytes go

    1 / 5

    Qwen2.5 7B: 7,615,616,512 parameters
    × 2 bytes each (16-bit)
    = 15.2 GB, before you type a word

    The real download, qwen2.5:7b-instruct-fp16: 15 GB. A 16 GB card is already full.

    Hugging Face model pages, Ollama library, NVIDIA, Hugging Face and Cloudflare docs · checked 2026-10-22

    7.6 billion numbers, 2 bytes each: 15 GB of memory before the chat even starts.

    Fewer bits per weight: quantization · what the cache holds: context window · free GPU quotas · run one locally

    Bộ nhớ = số tham số × số byte mỗi tham số, cộng một cache lớn dần theo ngữ cảnh: “7B” ở 16 bit là 14 GB trước khi bạn gõ, và 4 bit cắt xuống còn khoảng 4–5 GB.

  3. Một tham số (parameter, một con số đã học) ở 16 bit chiếm 2 byte, ở 8 bit một byte, ở 4 bit khoảng nửa byte. Vậy trọng số cần số tham số × số byte: 7B × 2 = 14 GB. Bên trên còn KV cache (bộ nhớ đệm key/value): với mỗi token trong cuộc chat, mỗi tầng giữ một key và một value. Ngữ cảnh càng dài, càng tốn bộ nhớ.

  4. 4 Bạn là model

    Bốn mô hình, bốn chỗ chạy miễn phí. Với mỗi mô hình, cộng trọng số, cache và runtime, rồi chọn chỗ nó vừa.

    model 1 of 4 · pick the free place it fits

    Mistral 7B at 4-bit (4.4 GB) for short chats, 4,096 tokens.

    Hugging Face model pages, Ollama library, NVIDIA, Hugging Face and Cloudflare docs · checked 2026-10-22 · runtime share illustrative

    Add it up: weights + cache + about 1 GB. Where does it fit?
  5. 5 Kiểm tra

    Cùng mô hình, cùng file. Bạn nâng ngữ cảnh từ 4.096 lên 32.768 token. Cái gì tăng?
  6. VRAM là bộ nhớ riêng của card đồ họa, loại nhanh. Khi mô hình lớn hơn một card, Ollama chia nó ra mọi GPU, rồi sang RAM thường: `ollama ps` hiện kiểu “48%/52% CPU/GPU”. Nó vẫn trả lời, chỉ chậm hơn. Lớn quá cả RAM của bạn? Dùng một API miễn phí có sẵn mô hình.

  7. 7 Nói lại bằng lời bạn

  8. 8 Nhiệm vụ · 5 phút

    Trong một notebook Kaggle miễn phí (đã xác minh số điện thoại), đặt Accelerator là “GPU T4 x2” và chạy !nvidia-smi. Đọc tổng bộ nhớ của từng card. Rồi tính: Qwen2.5 7B ở 16 bit (15 GB) cộng cache 4.096 token có vừa một card không? File 4 bit (4,7 GB) thì sao?

Ba câu nhanh

Rút ngẫu nhiên từ bộ câu hỏi của bài; lần sau sẽ khác.

Xong chưa?

Còn bây giờ: bạn giải thích được cho bạn bè chưa?

1 = hoàn toàn không · 5 = dễ dàng

Trả lời ba câu nhanh trước đã.

Nguồn

  • Hugging Face model API, safetensors parameter totals (checked 2026-10-22): meta-llama/Llama-3.1-8B-Instruct 8,030,261,248; Qwen/Qwen2.5-7B-Instruct 7,615,616,512; mistralai/Mistral-7B-Instruct-v0.3 7,248,023,552; google/gemma-3-27b-it 27,432,406,640 (all BF16)
  • https://ollama.com/library/llama3.1/tags, /qwen2.5/tags, /mistral/tags, /gemma3/tags (checked 2026-10-22): llama3.1:8b-instruct fp16 16GB, q8_0 8.5GB, q4_K_M 4.9GB; qwen2.5:7b-instruct fp16 15GB, q8_0 8.1GB, q4_K_M 4.7GB; mistral:7b-instruct-v0.3 fp16 14GB, q8_0 7.7GB, q4_K_M 4.4GB; gemma3:27b-it fp16 55GB, q8_0 30GB, q4_K_M 17GB
  • https://ollama.com/library/llama3.3 (checked 2026-10-22): llama3.3:70b 43GB (default 4-bit tag)
  • https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3/blob/main/config.json (checked 2026-10-22): num_hidden_layers 32, num_key_value_heads 8, hidden_size 4096, num_attention_heads 32 → head size 128; KV cache at 16 bits = 2 × 32 × 8 × 128 × 2 bytes = 131,072 bytes (128 KiB) per token; 4,096 tokens ≈ 0.54 GB, 32,768 ≈ 4.3 GB (arithmetic)
  • https://docs.ollama.com/faq (checked 2026-10-22): “By default, Ollama uses a context window size of 4096 tokens”; ollama ps Processor column, “48%/52% CPU/GPU means the model was loaded partially onto both the GPU and into system memory”; “If the model does not fit entirely on one GPU, then it will be spread across all the available GPUs”
  • https://www.nvidia.com/en-us/data-center/tesla-t4/ (checked 2026-10-22): GPU memory 16 GB GDDR6
  • aifree.dev catalog, kaggle-free-gpu-tpu (verified 2026-10-12): up to 30 hours/week GPU; “Accelerators: NVIDIA Tesla P100 (16GB), 2x NVIDIA T4, or TPU v3-8”; phone verification required
  • https://huggingface.co/docs/hub/spaces-zerogpu (checked 2026-10-22): default size large = half NVIDIA RTX Pro 6000 Blackwell, 48GB; free account 5 minutes daily GPU quota; Gradio SDK only
  • https://developers.cloudflare.com/workers-ai/platform/pricing/ (checked 2026-10-22): 10,000 Neurons per day free; @cf/meta/llama-3.3-70b-instruct-fp8-fast listed
  • https://research.google.com/colaboratory/faq.html (checked 2026-10-22): “The types of GPUs and TPUs that are available in Colab vary over time”; “Colab does not publish these limits”
  • The 1 GB runtime share in the picture and the role is illustrative, labelled as such; “slower” on CPU is qualitative, not measured here

Đăng Oct 22, 2026 · cập nhật Oct 22, 2026

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer