حول
Pool compute and memory across Macs and Windows PCs over Ethernet to run bigger GGUF models locally with llama.cpp RPC.
الأنظمة والبنية التحتيةالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- جارٍ جمع السجل
- خلال 15 يومًا
- جارٍ جمع السجل
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلshard
Run a local language model across a mix of Macs and Windows PCs. Pick one machine to coordinate inference and use the others as workers. Either operating system can fill either role. shard starts the workers and passes their addresses to llama.cpp RPC, which places the model layers and runs inference.
1. Connect the machines
- Power the laptops and a gigabit Ethernet switch. Use one Cat6 cable per machine.
- If a machine has a built-in Ethernet port, plug the cable into it. Otherwise, plug a USB-A or USB-C gigabit Ethernet adapter into the matching port, then plug the cable into the adapter. Connect the other end of each cable to the switch.
- Check the switch's link lights and confirm that each computer shows a connected Ethernet adapter. If an adapter is missing, try another port and install the driver for its exact model and hardware revision.
- Keep this Ethernet network private. llama.cpp RPC is unauthenticated. Wi-Fi can stay on for software and model downloads.
I bought a TP-Link TL-SG116 16-port gigabit switch, Cat6 cables, and TP-Link UE300 (USB-A) and UE300C (USB-C) adapters.
2. Give each machine a wired address
On a standalone switch, assign a different IPv4 address to each machine. For example, use 10.42.8.10 for the coordinator, then 10.42.8.11, 10.42.8.12, and so on for workers. Use subnet mask 255.255.255.0 (prefix length 24) and leave gateway/router and DNS blank on this isolated link. If a trusted network already provides addresses, use the machines' wired addresses instead.
- macOS · Open System Settings → Network. Select the wired adapter, then Details → TCP/IP. Set Configure IPv4 to Manually, enter the address and subnet mask, and save. Apple Ethernet settings
- Windows · Press Win+R, enter
ncpa.cpl, and open Properties on the connected Ethernet adapter. Select Internet Protocol Version 4 (TCP/IPv4) → Properties → Use the following IP address. Enter the address and subnet mask, then save. Microsoft TCP/IP settings
3. Install the runtime
Install Python 3 on each machine. On GitHub, choose Code → Download ZIP and extract it, or run these commands if you have Git:
git clone https://github.com/maddiedreese/shard.git
cd shard
Open a terminal in the extracted repo. The examples use python3 on macOS. In Windows PowerShell, use py -3 or python, depending on your Python installation.
Extract matching RPC-enabled llama.cpp builds for each operating system and CPU architecture. I used Unsloth build b12776-mix-ef2df21. Choose bundles from the same build for the coordinator and workers. If a suitable bundle is unavailable, build llama.cpp with GGML_RPC=ON.
In the commands below, replace ./runtime with the directory containing llama-cli on the coordinator or ggml-rpc-server on a worker. On Windows those files end in .exe. Keep their bundled libraries beside them. Store the GGUF on the coordinator. Workers receive the tensors assigned to them at load time.
4. Start the workers
From the repo directory on each worker, run this with that machine's wired address. Leave its terminal open.
python3 shard.py --bin-dir ./runtime worker --bind 10.42.8.11
Repeat on each additional worker using its own address. To select a specific backend, pass server flags after --. For example, append -- --device CPU to use the CPU backend. For a different listening port, add --port 50053 before -- and use 10.42.8.11:50053 in the coordinator command.
If macOS asks whether to accept incoming connections for ggml-rpc-server, choose Allow on the private test network. On a Windows worker, if the port is blocked, run this in administrator PowerShell, substituting the worker and coordinator addresses. Microsoft firewall rule reference
New-NetFirewallRule -DisplayName "shard RPC from coordinator" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 50052 -LocalAddress 10.42.8.11 -RemoteAddress 10.42.8.10
5. Test and run a model
From the coordinator, list the worker devices, then run a small test. Replace the example addresses with your workers' wired addresses.
python3 shard.py --bin-dir ./runtime run 10.42.8.11 10.42.8.12 -- --list-devices
python3 shard.py --bin-dir ./runtime run 10.42.8.11 10.42.8.12 -- -hf ggml-org/gemma-3-1b-it-GGUF:Q4_K_M -c 256 --single-turn --show-timings -n 32 -p "Say hello."
To run a different model, supply its Hugging Face GGUF ID with -hf, or a local GGUF with -m:
python3 shard.py --bin-dir ./runtime run 10.42.8.11 10.42.8.12 -- -m "/path/to/model.gguf" -c 1024 -p "Hello."
Add worker addresses before -- as needed. shard has no fixed worker count. The practical limits are your network, the llama.cpp build, the model architecture, context length, and available memory. Everything after -- goes to llama-cli. The coordinator may also do inference, and a connected worker can receive zero layers. Check the device list and model buffer lines to see where the weights landed.
If a worker is missing, check the link lights, IP and port, firewall rule, and matching runtime build. Run --list-devices with one worker at a time to isolate a problem. Stop manually started workers with Ctrl+C in their terminals.
Optional Mac-to-Windows setup
For a Mac coordinator and Windows CPU workers on the example subnet, bash shard.sh share serves an installer over Wi-Fi. Open the printed URL on each Windows worker, extract the ZIP, open shard-setup, and run its numbered launcher as administrator. bash shard.sh usb /Volumes/YOUR_USB prepares the same kit for USB. Use Setup-Worker.cmd to enter additional numbers or explicit addresses. For a custom network, set SHARD_MAC_IP and SHARD_PREFIX_LENGTH when generating the kit and running the Mac launcher.
Run bash shard.sh check 1 2, then bash shard.sh deploy 1 2, then bash shard.sh start 1 2 on the Mac. Leave the last command open and run bash shard.sh gemma 1 2 in a second terminal. The Windows scripts require a recent Windows 10 or 11 build with tar.exe. If SCP resets during transfer, retry with SHARD_LEGACY_SCP=1 bash shard.sh deploy 1 2. If you set a passphrase for the generated SSH key, load it with ssh-add ~/.ssh/shard_ed25519 before deploying.
My Nemotron experiment
I ran NVIDIA Nemotron Ultra 253B IQ1_S on a 16 GB M3 MacBook Pro and four Windows CPU workers. It answered 2 + 2 in 11m 51s from launch and generated at 0.042 tokens/s. Experiment details, layer placement, and reproduction command
License
MIT · Maddie D. Reese. llama.cpp and model weights are distributed separately under their respective licenses.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…