llm_backends
Skill2 starsChanged 3 months agoMITView on GitHub
Discover, audit and use local LLM servers (LM Studio, Ollama, LocalAI, vLLM, llama.cpp) on this machine or the network to offload work from the cloud and save tokens. Use when the user mentions local models, LM Studio, Ollama, "run it locally", token savings via local hardware, or wants to know what models their machine can run.
In this repository75 other files it gives its agents.
- AGENTS.mdAGENTS.md
- clean-cacheSkill
- agent-cacheSkill
- app_testSkill
- asset-qualitySkill
- auto_distillSkill
- auto-memorySkill
- auto_routerSkill
- benchSkill
- bootstrapSkill
- botte-proxySkill
- cacheSkill
- capabilitiesSkill
- cardinalSkill
- cavemanSkill
- checkupSkill
- clarificationSkill
- clusterSkill
- code_fingerprintSkill
- completion_proofSkill
- conductorSkill
- context_budgetSkill
- context_profilerSkill
- context_slicerSkill
- context_windowsSkill
- control_loopSkill
- cost_estimatorSkill
- cwe_kbSkill
- dag_optimizerSkill
- dashboardSkill
- decision-ladderSkill
- demoSkill
- diff_languageSkill
- directives_auditSkill
- docgenSkill
- docs_stewardSkill
- eventsSkill
- fallow_likeSkill
- fast_contextSkill
- fixSkill
- harness_deltaSkill
- hermes-bridgeSkill
- hf_provenanceSkill
- infra_advisorSkill
- ingestSkill
- llm_mcpSkill
- loaderSkill
- mcp_gatewaySkill
- meta_harnessSkill
- metricsSkill
- migration_auditSkill
- monte_cristoSkill
- mousquetairesSkill
- nlp_deterministicSkill
- nn_auditSkill
- prefix-prunerSkill
- prefix_treeSkill
- preflightSkill
- prompt_improverSkill
- reportSkill
- The first 60 shown.
The file
Files
llm_backends — Local LLM discovery, audit & routing
Turn idle local hardware into a token-saving tier. Every task served by a local model is a task not billed to the cloud.
When to use
- The user mentions LM Studio, Ollama, LocalAI, vLLM, llama.cpp, "local model", "run it locally", or "use my GPU".
- You need to know what models are reachable (this machine or the network).
- A task is cheap/local-suitable (classification, extraction, short summary, routing, spell-check, simple Q&A) and could skip the cloud entirely.
- The user has no local model yet and wants step-by-step, hardware-aware setup.
Quick commands
# Discover + register backends (writes configs/llm-endpoints.json)
python -m skills.llm_backends.cli scan # localhost only
python -m skills.llm_backends.cli scan --subnet # sweep local /24
python -m skills.llm_backends.cli scan 192.168.1.47 # specific host(s)
# What's registered?
python -m skills.llm_backends.cli list
# Audit: are local models used? what can this machine run? next steps?
python -m skills.llm_backends.cli audit --fresh
# Run a prompt locally (0 cloud tokens)
python -m skills.llm_backends.cli chat "classify: bug or feature?" --max-tokens 128
# Suggest a local model for a project (adaptive per project type)
python -m skills.llm_backends.cli profile ~/my-projectProgrammatic use
from skills.llm_backends import registry, quick_chat, audit
registry.refresh() # discover + persist
best = registry.best_chat_backend() # lowest-latency chat backend
model = registry.preferred_model(best) # coder/instruct over voice/reasoning
res = quick_chat("summarize in 1 line: ...", max_tokens=200)
print(res.text, res.total_tokens) # all local — no cloud costSupported backends
| Backend | Default port | API |
| LM Studio | 1234 | OpenAI /v1 |
| Ollama | 11434 | native /api/tags + OpenAI /v1 |
| LocalAI | 8080 | OpenAI /v1 |
| vLLM | 8000 | OpenAI /v1 |
| Jan / KoboldCpp / text-gen-webui | 1337 / 5001 / 5000 | OpenAI /v1 |
| ComfyUI | 8188 | image gen |
| Qdrant | 6333 | vector search |
How it saves tokens
- Audit finds reachable local backends and profiles RAM/VRAM/GPU.
- Route sends local-suitable tasks (see
tiered_routerL0/L1) to a local model. - Call runs them via the OpenAI-compatible client — zero cloud tokens.
- Onboard users with no local model, recommending the largest model their hardware can run and the right server to install.
Related: [[llm_mcp]] (MCP tools for agents), tiered_router (cost tiers),
local_router (task→backend mapping), response_cache (skip repeated calls).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

