I kept rebooting my machine to run local LLMs, so I built canfit

I kept rebooting my machine to run local LLMs, so I built canfit

●1 ●7
calendar_today ago • schedule2 min read
— Originally published at dev.to

The frustration

While building my previous open-source project, Knemora, I was running local LLMs on my Mac alongside Docker, a browser with too many tabs and everything else a developer keeps open. Memory kept running out.

Every time, the same question: what can I close safely, without killing something macOS needs?

The classic top shows you numbers, not answers.
It doesn't tell you whether the model you're about to load will fit, and it doesn't tell you which of those hundreds of processes are safe to close. More than once I just gave up and rebooted.

So I built the tool I wanted.

Meet canfit

canfit is the top command for people running local LLMs and apps.
It tells you if a model or an app can launch right now and, if it can't, what you can safely close to make room. System processes are never touched.

It's a single Rust binary for macOS, Windows and Linux, MIT licensed, with no telemetry: all data stays on your machine.

Your terminal, Your theme

What it does

Can I launch it?

Point canfit at a GGUF model or an app and it checks it against the memory you have right now:

canfit model.gguf                    # can I launch this model?
canfit model.gguf --ctx 32768        # ...with a 32k context
canfit "Docker Desktop" model.gguf   # both together?

For GGUF files it reads the header (parameters, quantization, layers, tensor sizes) and estimates weights + context cache + overhead. On Apple Silicon it also checks the GPU wired limit, because the GPU can only use part of unified memory.

What should I close?

If it doesn't fit, canfit suggests the smallest set of apps to close:

canfit free model.gguf

Every process is classified as safe, caution or never. System processes are never suggested, unknown processes default to caution, and nothing is closed without your confirmation.

A friendlier top

Run canfit with no arguments and you get a live monitor that starts with a sentence instead of a table ("Memory under pressure: Chrome is using 9 GB"), with processes grouped by app.

Watch

canfit watch -- llama-server -m model.gguf

Launch a command through canfit and it measures its real memory usage, so the next estimate is based on what actually happened.

Script-friendly

Every command supports --json, and the fit check returns an exit code (0 fits, 1 tight, 2 doesn't fit):

canfit model.gguf && llama-server -m model.gguf

Features overview

Canfit answers

Fit check works

Install

canfit is available through Homebrew, Scoop, curl, PowerShell, .msi, .deb, .rpm and cargo install --git.

The exact commands for each platform are in the README:

👉 https://github.com/federicolaterra/canfit

Help me make the estimates better

This is 1.0.0, and memory estimates are the part I care about most.

And if you find it useful, a ⭐ on GitHub helps a lot.

Thanks for reading!

Want more #opensource & #llm deep dives?

Join 5,969+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

2 Comments

0 votes
0

More Posts

AAIF Hits 10 Projects. Its CTO on What to Adopt Now and the Security Gaps Left Open

Tom Smithverified - Oct 23

Architecting a Local-First Hybrid RAG for Finance

Pocket Portfolio - Feb 25

Sovereign Intelligence: The Complete 25,000 Word Blueprint (Download)

Pocket Portfolio - Apr 1

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

A coach complained, so I built sports academy management software

rahuldk1105 - Oct 26
chevron_left
3Posts
2Comments
3Connections
Applied AI Engineer | AI Agents • RAG • MCP • LLMs | Full Stack Developer | Web Engineer | Lead UX/U... Show more

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!