Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
AIRigs
  1. Home
  2. Models
  3. Local LLMs
  4. New to Local LLMs? Start here!

New to Local LLMs? Start here!

Scheduled Pinned Locked Moved Local LLMs
1 Posts 1 Posters 64 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    F
    fedes1to
    wrote on last edited by fedes1to
    #1

    Welcome! This guide will teach you the basics for large language models (LLMs) running on your own hardware. LLMs are used for generating text, so it will be useful for coding, chatting and so on.

    1. Know the basics

    We will use some terms that might be new to you so here's a simple definition for each:

    • Model weights: The learned numerical values that define a model.
    • Token: What the LLM perceives as a "piece of text". Can be a word, part of it, or something else.
    • Parameters: Learned values that make up the model.
    • Quantization: Storing model weights at lower precision to reduce memory usage, for example, Q4_0 uses ~4 bits per weight.
    • Context: Amount of tokens that a model can remember.
    • KV cache quantization: Reducing the precision of the context.

    2. Choosing an engine

    The inference engine is the program that loads the model, and serves it to your tools. Here are some baseline recommendations.

    1. llama.cpp: Simplest to use, has a WebUI, lots of support. There almost always is a better option or atleast a fork that better suits your workload (especially on MoE's), but a good starter nonetheless.
    2. vLLM: The gold standard, supports almost any model but picky on hardware, awesome concurrency but lacks good offloading, lets you pick between many kernels (Flash Attention, Flashinfer, ...).

    Note: there are many many more options, if your card has good support consider using engines specifically for your hardware (e.g. ninfer, halogen).

    3. Choosing a model

    Usually VRAM will be your limiting factor, so start by running a model that will comfortably fit in yours, remember that you have to fit the model weights + KV cache + runtime overhead.

    Also note that engines can only run specific model "packaging" formats, as an example:

    • llama.cpp (and its forks) can run GGUFs.
    • vLLM can run safetensors.

    For starters, to overcome this limitation, we will use:

    • Quantization (4-6bit is a good baseline, includes Q4_K_M, Q6_K_XL, W4A16, ...).
    • KV Cache quantization (8bit is a good baseline, includes q8, fp8, int8, ...).

    To improve our speeds we can also use drafting, although this will have a small VRAM penalty.

    You can also overcome this limitation by using MoE models instead of dense ones, explained here.

    4. Actually running it

    If you plan on running multiple models on different engines, I recommend llama-swap, it simplifies greatly the process.

    As a tip, to configure these engines, don't just tell a model to "Optimize and run for X hardware". Instead, understand what the launch parameters do and specify it to the model, for example:
    "Install beellama.cpp latest on this machine and setup X model, use the Q4_K_XL and Q8 kv cache, I plan to have no concurrency, and I don't mind it loading slowly, make me a script to run it with and without drafting".

    No AI used
    1 Reply Last reply
    0
    • F fedes1to referenced this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    Powered by NodeBB Contributors
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups