agentleFS
JlosevJlosev/agent-skills/skills/local-llm/SKILL.md

local-llm

Skill1 starsChanged 15 days agoMITView on GitHub

Используй когда нужна пачка однотипной разметки, тегов или саммари без инструментов и MCP. Триггерные фразы «локальная модель», «LM Studio», «offload», «дешёвый complete». Не используй для judgment-heavy classify другого пайплайна, outbound-чата, mutate задач или Task-субагента.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default модель google/gemma-3-12b (см.

    line 61

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Based on: LM Studio OpenAI-compat structured output (https://lmstudio.ai/docs/developer/openai-compat/structured-output); LM Studio #1971 (reasoning_content fallback); LM Studio #1105 (GPT-OSS + strict schema hang) -->

Local LLM

Облако решает и оркестрирует. Локальная модель только считает JSON. Вызов – Shell, не Task.

{SKILL_DIR} = directory of this SKILL.md.

Гейт – references/when-to-use.md. Default-модель – references/model-pick.md.

Preconditions

  • Прочитан references/when-to-use.md; гейт пройден (все три пункта).
  • Есть JSON-схема (или короткий шаблон полей) и входной текст.
  • LM Studio server на LOCAL_LLM_BASE_URL или http://127.0.0.1:1234/v1.

Алгоритм

Шаг 1 – гейт

Read references/when-to-use.md. Не все три пункта → не звать скрипт, сделать самому, одной строкой почему.

Шаг 2 – health

python3 "{SKILL_DIR}/scripts/local_complete.py" --health

Exit ≠ 0 → fallback, не ретраить.

Шаг 3 – файлы

Промпт, схему и --out писать только в .tmp/local-llm/.

Шаг 4 – complete

python3 "{SKILL_DIR}/scripts/local_complete.py" \
  --prompt .tmp/local-llm/prompt.txt \
  --schema .tmp/local-llm/schema.json \
  --out .tmp/local-llm/out.json

Default модель google/gemma-3-12b (см. references/model-pick.md). Переопределение --model / LOCAL_LLM_MODEL. Load: --gpu max -c 8192 --parallel 1 --ttl 900 (LOCAL_LLM_GPU / LOCAL_LLM_CONTEXT / LOCAL_LLM_PARALLEL / LOCAL_LLM_TTL).

Шаг 5 – результат

Прочитать --out. Exit 4 → один retry только если это parse. Иначе fallback.

Не запускать Task. Не ходить в MCP с локалки. Complete сам делает lms load с gpu/ctx/parallel/ttl, если модель в каталоге, но не loaded.

Шаг последний – retro

Одной строкой: что улучшить в скилле после этого прогона.

Hard Stop Rules

  • Task / новый агент для локалки запрещены.
  • lm-studio-subagents запрещён – Task или REST без json_schema не замена этому скиллу.
  • Авто-load только через скрипт. lms load <id> --yes --gpu max -c 8192 --parallel 1 --ttl 900. LOCAL_LLM_TTL=0 – без TTL. Load fail → exit 3, fallback.
  • Нет третьего identical retry.
  • Stdout скрипта не смешивать с диагностикой; диагностика у скрипта в stderr.
  • Не заменять judgment-heavy classify другого пайплайна этим скиллом.

Exit codes

КодСмысл
0ok
2сервер недоступен / timeout
3нет instruct / модель не loaded
4ответ не JSON или нет required

Definition of Done

  • Гейт пройден или явно отвергнут.
  • При вызове скрипта есть --out с валидным JSON или fallback без Task.
  • Скрипт agent-compatible-cli: stdout = JSON only, stderr = диагностика, non-interactive.
  • Артефакты только в .tmp/local-llm/.
  • Retro-строка записана.

Пример

Вход: пачка заголовков + схема {tag, noise}.

Шаги 2–4 → .tmp/local-llm/out.json.

Результат (фрагмент):

{"tag": "fyi", "noise": false}

Fallback: exit 3 после неудачного авто-load → оркестратор размечает сам.

Команды проверки

grep -E '^## (Hard Stop Rules|Definition of Done|Команды проверки|Scope|Gotchas|Алгоритм|Пример|Preconditions)' \
  "{SKILL_DIR}/SKILL.md"

python3 "{SKILL_DIR}/scripts/test_local_complete.py"
python3 "{SKILL_DIR}/scripts/local_complete.py" --health

Gotchas

  • /v1/models показывает скачанные, не loaded. Скрипт смотрит /api/v0/models (state); not-loaded → lms load --yes, потом POST.
  • Retry taxonomy: exit 2 (transport) – не ретраить; exit 3 (availability) – не ретраить; exit 4 (parse) – один retry.
  • Модели ≥7B для json_schema – см. LM Studio structured output. Модели <7B на схеме ненадёжны – не default. Easy-фикстура может пройти копированием текста; hard-кейсы ломают urgency.
  • GPT-OSS + strict schema может зависнуть (LM Studio #1105) – не default-модель для схемного complete.
  • Пустой content, JSON в reasoning_content – скрипт принимает fallback (LM Studio #1971).
  • google/gemma-4-26b-a4b-qat игнорирует -c 8192 и грузится с ctx ~226k – не default.
  • Две instruct в RAM сразу не грузить на 48 GB unified (запас на IDE).

Scope

In: схемный/шаблонный complete на уже скачанной модели LM Studio
Out: субагент, judgment-heavy classify другого пайплайна, outbound-чат, mutate задач, ручной lms load в обход скрипта, ngrok
Fallback: скрипт ≠ 0 → оркестратор делает сам

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.