From sundial-org-awesome-openclaw-skills-4
Offloads tasks like summarization, extraction, classification, rewriting, first-pass review, and brainstorming to local LM Studio models via REST API to cut token usage from paid providers. Supports JIT loading with LM Studio 0.4+ server for cost savings, high-volume work, and privacy.
npx claudepluginhub joshuarweaver/cascade-ai-ml-agents-misc-2 --plugin sundial-org-awesome-openclaw-skills-4This skill uses the workspace's default tool permissions.
Offload tasks to local models when quality suffices; avoid web/proprietary/high-stakes.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Offload tasks to local models when quality suffices; avoid web/proprietary/high-stakes.
Trigger in frontmatter; below = implementation.
LM Studio 0.4+, server :1234, models on disk; load/unload via API (JIT optional); Node for script (curl ok).
GET /api/v1/models; non-200 or connection error = server not ready.
exec command:"curl -s -o /dev/null -w '%{http_code}' -H 'Authorization: Bearer lmstudio' http://127.0.0.1:1234/api/v1/models"
exec command:"curl -s -H 'Authorization: Bearer lmstudio' http://127.0.0.1:1234/api/v1/models"
Parse models[] (key, type, loaded_instances, max_context_length, capabilities, params_string). If a model has loaded_instances.length > 0 and fits task, skip to Step 5; else pick key for chat (and optional load). Note loaded_instances[].id for optional unload.
Pick key from GET response; use as model in chat (optional load). Constraints: vision -> capabilities.vision; embedding -> type=embedding; context -> max_context_length. Prefer loaded (loaded_instances non-empty), smaller for speed/larger for reasoning; fallback primary. Optional POST load; else JIT on first chat.
Optional: POST /api/v1/models/load { model, context_length?, ... }. JIT: first chat loads; explicit load only for specific options.
If explicit load: GET models, confirm loaded_instances. If JIT: no verify; first chat returns model_instance_id, stats.model_load_time_seconds.
From the skill folder: node scripts/lmstudio-api.mjs <model> '<task>' [options].
exec command:"node scripts/lmstudio-api.mjs <model> '<task>' --temperature=0.7 --max-output-tokens=2000"
Stateful: add --previous-response-id=<response_id>. Curl: POST /api/v1/chat, body model, input, store, temperature, max_output_tokens; optional previous_response_id. Parse: output (type message) -> content; response_id, model_instance_id, stats. Script outputs content, model_instance_id, response_id, usage.
Optional: POST /api/v1/models/unload { instance_id }. instance_id from loaded_instances[].id or chat model_instance_id. JIT+TTL auto-unload; explicit when needed.
exec command:"curl -s -X POST http://127.0.0.1:1234/api/v1/models/unload -H 'Content-Type: application/json' -H 'Authorization: Bearer lmstudio' -d '{\"instance_id\": \"<instance_id>\"}'"
GET /api/v1/models, then script with model key and task. Optional unload per Step 6 (instance_id from response or GET).
exec command:"curl -s -H 'Authorization: Bearer lmstudio' http://127.0.0.1:1234/api/v1/models"
exec command:"node scripts/lmstudio-api.mjs meta-llama-3.1-8b-instruct 'Summarize and extract 5 key points' --temperature=0.7 --max-output-tokens=2000"
Helper/API: see Step 5. Output: content, model_instance_id, response_id, usage. Auth: Bearer lmstudio. List GET /api/v1/models. Load POST /api/v1/models/load (optional). Unload POST /api/v1/models/unload { instance_id }.