Skip to main content

localfit

One command for local, Kaggle, and cloud inference — and an honest answer to "will it fit?"

PyPI Python License

pip install localfit

Both localfit and llmrun are installed as commands and do the same thing.

New in 2.1: a free 3D studio (photo to animated character)

Photo to 3D model, video to motion capture, text to motion, rigging and Blender renders. Jobs run on a free Kaggle T4 by default (30 GPU hours a week). Modal, RunPod and Lightning AI are opt-in and refuse to start without a hard spending cap. Rigging and renders use your local Blender (free).

pip install "localfit[3d]"
# once: kaggle.com > Settings > API > Create New Token, save it as ~/.kaggle/kaggle.json
localfit 3d generate chef.png                        # image to 3D on a free Kaggle T4
localfit 3d text-motion "a person does a backflip"   # HY-Motion 1.0 Lite on a free T4
localfit 3d models                                   # every model, backend, licence and measured time
localfit 3d usage                                    # GPU time and $ per backend

Use it from Claude Code, one line, nothing else to install:

claude mcp add localfit-3d -- uvx --from "localfit[3d]" localfit 3d mcp

Then ask: "make a 3D model from ~/chef.png, rig it and make him do a backflip". The server has 17 tools (image_to_3d, text_to_motion, video_to_mocap, animate_character, render_3d_in_blender, gpu_usage, ...). Each job returns an id at once; Claude polls it until the GLB or motion clip is downloaded.

Licences: every model keeps its own (localfit 3d models prints it). The HY-Motion and Hunyuan3D licences exclude the EU, the UK and South Korea and ask that output is labelled as AI generated. The built-in motion clips come from the CMU Graphics Lab Motion Capture Database (mocap.cs.cmu.edu), created with funding from NSF EIA-0196217.

Run any model, wherever it fits. Fits locally? Run it. Doesn't fit? Free Kaggle GPU. Still too big? RunPod. One command downloads the model, starts the server, configures your tools and launches the UI.

Will it fit?

The question every local-LLM guide gets wrong. On Apple Silicon your Mac's RAM is not what the GPU gets — Metal hands it roughly 74 %:

your Mac what Metal actually gives the GPU
16 GB 11.8 GiB
24 GB 17.8 GiB
36 GB 26.6 GiB
48 GB 35.5 GiB

Check your own machine: ioreg -l | grep recommendedMaxWorkingSetSize, divide by 2³⁰.

A 19.5 GB model on a 24 GB Mac is 110 % of budget. It does not fail politely — it kernel-panics the machine. localfit scores every quant in a repo against the budget that actually exists:

localfit qwen3.8-27b                 # score against THIS machine
localfit qwen3.8-27b --gpu-gb 12     # score against a 12 GB card
localfit qwen3.8-27b --gpu-gb 17.8   # ...or someone else's 24 GB Mac

--gpu-gb is how you answer the question for hardware you do not own.

Vision projectors (mmproj-*, *-vision-*.gguf) are excluded from quant scoring — unfiltered, a 0.9 GB projector parses as an F16 quant, scores quality 100, and beats every real quant in the repo.


One Command — Everything Works

# Chat + image gen in Open WebUI (gemma4 LLM + Flux Klein 4B images)
llmrun launch openwebui --model gemma4:e4b --img klein-4b

# Code with image gen in localcoder
llmrun launch localcoder --model gemma4:e4b --img klein-4b

# Claude Code with image MCP tools
llmrun launch claude --model gemma4:e4b --img klein-4b

# Model doesn't fit locally? Run on free Kaggle GPU
llmrun launch openwebui --model gemma4:26b --remote kaggle

# Need more power? RunPod cloud ($0.22/hr)
llmrun launch openwebui --model gemma4:26b --img klein-9b --remote runpod --budget 30m

llmrun auto-detects your hardware, downloads models, installs Ollama if needed, starts the image server, configures Open WebUI with image generation enabled, and opens your browser. Zero manual config.

The Run Menu

llmrun run gemma4:e4b

Interactive menu with arrow key navigation — pick your backend before anything downloads:

╭──────────────────────── gemma-4-E4B ────────────────────────╮
│   LOCAL                                                     │
│   › MLX   gemma-4-E4B-4bit                      3.5GB      │
│     GGUF  Q4_K_M                                4.4GB      │
│     GGUF  Q8_0                                  7.5GB      │
│                                                             │
│   REMOTE                                                    │
│     Kaggle  T4 16GB                               free      │
│     RunPod  RTX 3090 24GB                     $0.22/hr      │
╰──────────────────────── Apple Silicon 24GB ─────────────────╯

Image Generation

One server, two APIs — works with Open WebUI, Claude Code, and any OpenAI-compatible client.

# Starts automatically with --img flag, or manually:
python -m llmrun.image_server 8189 klein-4b 4

The server implements OpenAI-compatible POST /v1/images/generations and multipart POST /v1/images/edits. llmrun configures both Open WebUI engines automatically when --img is present.

Supported Image Models

Model Pipeline Params Local Mac Kaggle T4 RunPod 3090
FLUX.2 Klein 4B Flux2KleinPipeline 4B 24s 65s 2s
FLUX.2 Klein 9B Flux2KleinPipeline 9B mflux cpu_offload 3090+
FLUX.1 Schnell FluxPipeline 12B 79s cpu_offload 3090
FLUX.1 Dev FluxPipeline 12B mflux cpu_offload 3090+
Z-Image-Turbo ZImagePipeline 6B 90s T4 3090
Qwen-Image QwenImagePipeline 20B — — A6000+
Qwen-Image-Edit QwenImageEditPlusPipeline 20B — — A100
SDXL StableDiffusionXLPipeline 6.6B diffusers T4 3090
SD 3.5 Large StableDiffusion3Pipeline 8B diffusers T4 3090

All models auto-detected via DiffusionPipeline.from_pretrained().

MCP Server for Claude Code

claude mcp add llmrun-image --transport stdio -- python3 -m llmrun.mcp_image

6 tools available:

Tool Description
check_resources GPU/VRAM info, loaded model, ETA estimates
generate_image Text-to-image with timing + Image object
edit_image Image-to-image editing
show_image Display image in terminal via timg
list_image_models Available models
image_server_status Server health

Benchmarks (Verified)

Platform GPU Model Size Steps Time
Mac M4 Pro Klein 4B 1024x1024 4 24s
Mac M4 Pro Schnell 512x512 4 79s
Kaggle T4 16GB Klein 4B 512x512 4 65s
RunPod RTX 3090 Klein 4B 512x512 4 2s

LLM Backends

Ollama (Default)

llmrun run gemma4:e4b               # auto-installs Ollama, pulls model, serves

MLX (Apple Silicon)

pip install mlx-lm
llmrun run gemma-3-4b-it            # auto-picks mlx-community model

GGUF (llama.cpp)

llmrun run gemma4:26b               # downloads best GGUF quant for your GPU

Remote Serving

Kaggle (Free — 30h/week GPU)

llmrun login kaggle
llmrun run gemma4:e4b --remote kaggle

RunPod (Paid — any GPU)

llmrun login runpod
llmrun run gemma4:26b --cloud --budget $2

Combined Remote Chat + Diffusers

llmrun launch openwebui \
  --model HauhauCS/Qwen3.6-35B-A3B-Uncensored-HauhauCS-Aggressive \
  --quant Q8_K_P \
  --img Qwen/Qwen-Image-Edit-2511 \
  --lora ScottzillaSystems/qwen-image-edit-plus-nsfw-lora \
  --remote runpod \
  --budget 30m

Text and image workloads use separate right-sized RunPod pods and separate state files. Each pod receives the same absolute provider-side deadline, an in-pod deadline guard, and the scheduled host reaper. Open WebUI is launched only after both OpenAI-compatible endpoints pass health checks. llmrun --stop discovers and terminates every managed pod, including sessions whose local state vanished.

This is full-weight Diffusers loading; no image quantization is silently applied. GPU cost is shown and approved separately for each pod.

ComfyUI on Kaggle or RunPod

# Current official ComfyUI + Manager on a free Kaggle T4, auto-stop after 15m
llmrun comfyui --remote kaggle --duration 15

# Large video/audio profile on RunPod; GPU and exact maximum cost are confirmed
llmrun comfyui MiniMaxAI/MiniMax-H3 --cloud --budget 30m

ComfyUI is a separate visual workflow runtime, not an OpenAI image endpoint. RunPod ComfyUI pods use the same provider terminateAfter, in-container guard, five-minute launchd reaper, and provider orphan discovery as text and Diffusers pods. Kaggle uses current official ComfyUI and its built-in Manager instead of the obsolete PyTorch/ComfyUI pins in older community notebooks.

MiniMax H3 is video plus native stereo audio, not a chat or still-image model. It cannot fit Kaggle's API-addressable 16GB GPU and is routed to an 80GB RunPod profile. Because H3 is a multi-file workflow, llmrun starts ComfyUI and leaves asset placement to its maintained H3 template/Manager instead of guessing paths.

Rebrand and compatibility

llmrun is the primary package, executable, UI name, and documentation name as of 2.0. The deprecated localfit executable and Python implementation package remain during the migration. Existing ~/.localfit state, RunPod environment metadata, ntfy topics, and tool-provider IDs are intentionally retained so old pods and configurations remain recoverable. Do not delete that directory while a legacy session may still exist.

Launch Any Tool

Tool Command
Open WebUI llmrun launch openwebui --model MODEL --img IMAGE
Claude Code llmrun launch claude --model MODEL --img IMAGE
localcoder llmrun launch localcoder --model MODEL --img IMAGE
OpenAI Codex llmrun launch codex --model MODEL
OpenCode llmrun launch opencode --model MODEL
aider llmrun launch aider --model MODEL

All tools are auto-configured with the right endpoints. Env vars scoped to subprocess — your normal setup is never touched.

Make It Fit — Remote Quantization

llmrun makeitfit Qwen2.5-7B-Instruct
# → Quantizes on Kaggle (free) or RunPod
# → Uploads to your HuggingFace repo
# → Run it: llmrun run yourname/model-Q4_K_M-GGUF-llmrun

All Commands

# Model management
llmrun run MODEL                    # interactive menu → serve
llmrun run MODEL --remote kaggle    # serve on free Kaggle GPU
llmrun run MODEL --cloud            # serve on RunPod
llmrun run MODEL --img IMAGE_MODEL  # serve LLM + image model
llmrun show MODEL                   # quants + fit analysis + pricing
llmrun list                         # installed models
llmrun stop                         # stop servers

# Image generation
llmrun launch openwebui --img klein-4b    # with Open WebUI
llmrun launch claude --img klein-4b       # with Claude Code MCP

# Tools
llmrun launch TOOL --model MODEL    # serve + launch tool
llmrun doctor                       # check all tool configs

# Hardware
llmrun                              # GPU dashboard + trending models
llmrun health                       # VRAM, temp, processes
llmrun bench                        # benchmark models
llmrun simulate                     # "will this model fit?"

# Cloud
llmrun login kaggle                 # save credentials
llmrun login runpod                 # save API key
llmrun login huggingface            # save HF token
llmrun comfyui --remote kaggle --duration 15
llmrun comfyui MODEL --cloud --budget 30m
llmrun --remote-status              # check Kaggle session
llmrun --remote-stop                # stop remote session

# System
llmrun check                        # check prerequisites
llmrun cleanup                      # free GPU memory
llmrun makeitfit MODEL              # quantize remotely

Supported Platforms

Platform GPU LLM Image Gen
macOS Apple Silicon Metal MLX + llama.cpp + Ollama mflux (MLX native)
Linux NVIDIA CUDA llama.cpp + Ollama diffusers (CUDA)
Linux AMD ROCm llama.cpp + Ollama diffusers (ROCm)
Windows (WSL2) CUDA llama.cpp + Ollama diffusers (CUDA)
Kaggle (free) T4 16GB Ollama via tunnel diffusers via tunnel
RunPod (paid) Any GPU Ollama via tunnel diffusers via tunnel

Requirements

  • Python 3.10+
  • Optional: mflux for Mac image gen
  • Optional: Ollama (auto-installed by llmrun)
pip install llmrun                  # core
pip install mflux                     # + image generation (Mac)

License

Apache-2.0

Metadata

Release files for localfit 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localfit 2.1.0
File Size Uploaded Provenance Actions
localfit-2.1.0.tar.gz 3.4 MB Without provenance Details for localfit-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localfit 2.1.0
File Interpreter ABI Platform Actions
localfit-2.1.0-py3-none-any.whl Python 3 none any Details for localfit-2.1.0-py3-none-any.whl

Total release size: 6.8 MB

Release files / localfit-2.1.0.tar.gz

Download URL localfit-2.1.0.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
8e2fd1913ea049a3ed279ad59b06ef2ef6742decf61af421baf8aa8ebea3dc19
BLAKE2b-256 checksum
How to use checksums
10169e7ac5b2487ec5bf470d1335a570d23557a6bb6af2a330b0127f1b3b4915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / localfit-2.1.0-py3-none-any.whl

Download URL localfit-2.1.0-py3-none-any.whl
Size 3.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
51ccb647ee3d24c0becddac2f9411f6df05bc42ec59e7b48fc1c936a4dadbb9f
BLAKE2b-256 checksum
How to use checksums
fb064549ab0e029c893b96a42dab30ef6c312f3e6ffe666019f2ade668cabdf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for localfit 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page