Checking how many agents are working

How this works
Contacto
← Blog
A dark steel desk with a small terminal window glowing olive text and a graphics card beside it, with the AMARBARO mark above them.
✎publicación de blog

Running a chat model on your own PC, step by step

The short version

Running a local chat model is a short chain of checks, and the chain is easier when each step is verified before the next begins.

What this is about

This is the how-to of the series. We walk through running a chat model on your own machine with our engine, mojo-baro, in the order you would do it. For each step we say what it checks, so you know when to move on and where to look when it fails.

One honest note first. Our engine targets one kind of card: an AMD RDNA3 card with 24 GB, such as the RX 7900 XTX. If you have another setup, read the steps as a map of what any local setup does, and follow your own tool's instructions.

Why it matters

Running a model yourself keeps your text on your machine and teaches you how the pieces fit. It also fails in dull ways: a missing tool, a wrong file, a card that is busy. If you know the order of the steps, each failure points at one place.

What you need

From the project page, the engine needs:

  • an RDNA3 card, architecture gfx1100, with 24 GB;
  • Linux with ROCm 7.2;
  • the tools uv, Rust, and CMake with a C++ compiler, plus jq and curl;
  • 32 GB of main memory, which is enough for 9B models.

No model files ship with the repository. You bring your own GGUF file of a model it supports. Its README lists the models it supports. A GGUF file holds the weights and the facts about them, as an earlier article explains.

The steps

Step 1: Get the code and install the Python side.

git clone https://github.com/amarbarosys/mojo-baro && cd mojo-baro
uv sync

uv sync pins the toolchain to the version the engine was built with. If this fails, nothing else will work, so stop here and fix it.

Step 2: Build the server.

(cd serve && cargo build --release)

The server, baro-serve, is a small program written in Rust. It handles the chat layout, cuts text into tokens, queues requests and offers a health check. It talks to the engine, which is written in Mojo.

Step 3: Run the preflight.

bench/preflight.sh

This check needs no graphics card and no model file. It looks at your machine and the code. It is our rule: find problems on the CPU first, before the card is asked to do anything.

Step 4: Start the server with your model.

tools/baro serve ~/Models/Qwen2.5-7B-Instruct-Q4_K_M.gguf --port 8080

Replace the path with your own file. The first time you run a model of a new shape, the tool builds an engine for it and converts the file into a pack that the kernels can read quickly. That takes a few minutes. Both are cached under ~/.cache/baro/. The next start of the same file takes seconds. Do not interrupt the first build. A model shape is fixed when the engine is compiled, so an engine built for a 9B pack refuses a 27B pack.

Step 5: Ask one question with curl.

curl -s localhost:8080/v1/chat/completions -H 'content-type: application/json' -d '{
  "messages": [{"role": "user", "content": "Name the capital of France in one word."}],
  "max_tokens": 16000
}' | jq -r '.choices[0].message.content'

If an answer comes back, the whole chain works: file, engine, server, card. If it hangs, check the health route: curl localhost:8080/health returns 200 only when an engine can take work.

Step 6: Chat.

The tool has a terminal chat, tools/baro chat, and a desktop window, tools/baro gui, with a streaming chat pane, an engine panel and settings. Any program that speaks the OpenAI style of interface can also point at http://localhost:8080/v1. The next article explains that.

Where beginners get stuck

  • A wrong model shape. The engine builds for one shape. Give it a file it does not support and it refuses. Check the supported list first.
  • The card is busy. If another job holds the card's memory, the engine may not start or may crash. Look at the card's free memory before you start. The article on VRAM shows how.
  • Interrupting the first build. It is slow once, and fast afterward. Let it finish.
  • Expecting our speeds. On a 7B model with 4-bit K-quant weights we saw 132.8 tokens per second on our card, in a quick run of only three prompts. Your machine will differ. And the speed table in the README says which rows were measured on an older toolchain.
  • Skipping the check. Step 3 exists because beginners and experts both lose hours to problems it would have shown in seconds.

What we have not verified

The README says its desktop window's Apply step, which restarts the engine with new settings, has been tested only with a fake command, not on a real engine. And only one card has been measured. If you use another RDNA3 card, the kernels should build, but their tuning is not measured.

Words you may not know

  • GGUF: the file format that holds a model.
  • Pack: a rearranged copy of the weights that the engine's kernels read quickly.
  • Engine: the program that actually runs the model on the card.
  • Server: the program that takes requests over the network and passes them to the engine.
  • Port: a numbered door on your computer where a program listens, here 8080.
  • Health check: a request that tells you whether the server can take work.
  • Preflight: a check you run before the real thing.

Try it

  • A Model File That Carries Its Own Kernels, the deeper account of what our model files carry.
  • The GPU Is a Queue, about checking the card before a job.

Comentarios

Aún no hay comentarios.

Iniciar sesión para comentar.