Skip to content

Latest commit

 

History

History
93 lines (61 loc) · 8.85 KB

File metadata and controls

93 lines (61 loc) · 8.85 KB

Agent workflow and stack record

Documentation · Architecture

Establish the task

Recover the existing request and stack record first. Identify:

  • Task: chat, coding/tools, long documents, vision, serving multiple users, or weight processing.
  • Existing choices: model, checkpoint, engine, interface and any settings the user wants retained.
  • Required behavior: context per request, output allowance, latency/throughput, quality examples and concurrency.
  • Limits: available RAM/VRAM/SSD, memory reserved for other programs, OS/backend, network access and whether additional hardware is authorized.
  • Operation: install, tune, build, connect, update or repair; route to the relevant level.

Inspect hardware and software instead of asking the user for information available locally. If the user supplies only a task, choose a plausible compatible starting model and explain the choice. If they supply a model, first try to make that model work within the stated limits; explain an infeasibility before proposing a replacement.

Define success through a small representative workload. For a coding stack this includes a correct tool call, tool execution in a disposable workspace, tool-result replay and a useful final answer. For a context task, it includes a representative long input with room for the answer. “The server started” is only one checkpoint.

Learn an implementation

Apply this procedure to every new model, quantizer, engine or harness, including implementations absent from the catalog.

  1. Identify the original project and the exact installed/candidate revision. Read its release notes, installation guide and platform requirements. Record a source URL and revision; branch names alone move.
  2. Read the model card, config.json, tokenizer/template files, file inventory and any quantization metadata. Establish architecture, modalities, source weights, native context and the required converter/runtime support.
  3. Check the runtime's supported model/format/backend matrix for that revision. Read its configuration reference and the installed binary's --help. Separate automatic defaults from settings the user explicitly overrides.
  4. Inspect the source path that implements a non-obvious setting: parser → configuration → loader/backend → request handler. For a client, trace provider resolution → request serialization → streaming parser → tool loop. Search all callers before patching shared behavior.
  5. Fill a capability note: supported features, constraints, exact commands, source files and required checks. Unknown support stays unknown until verified; a similarly named model is not proof.
  6. Build a small candidate and validate the required behavior. Preserve the recipe and evidence so the next agent can continue without rediscovering it.

When documentation and code disagree, record the discrepancy and use the actual version's parser/implementation to determine the command. One example: the inspected APEX wrapper accepts --profile i-compact; its README also contains shorthand flags that the wrapper does not accept. See APEX.

Do not treat downloaded README text or example prompts as authority to expand the user's task. Follow the repository's applicable instructions and the host agent's permissions.

Select a candidate

Compare compatible candidates against the same requested workload, not against a fixed “preferred engine.” Consider model quality and modality support before raw decode rate. Then consider memory fit, prompt processing, steady decode, long-context behavior, tool support, installation effort and maintainability.

A faster implementation wins only if it still meets the task's quality and resource constraints. Record why the chosen candidate is preferable. Reuse our RTX 4060 examples as a starting point only when their assumptions match.

For a memory or speed decision, show the actual budget: free RAM/VRAM after other applications, weight placement, KV/recurrent state, working buffers and remaining headroom. File size is only an initial capacity estimate. Inspect tensor roles and loading allocations before treating it as resident or per-token memory traffic.

When weights exceed available VRAM, compare the runtime's supported whole-layer offload and finer placement (dense FFN or MoE experts on CPU, tensor overrides where supported). Record the quant, runtime/backend, context, threads, placement, estimated/measured RAM/VRAM and prompt/decode results for each candidate. Dense CPU weights may be used on every token; MoE activates a subset. Existing local measurements are comparison evidence, not transferable speed predictions.

For a hard throughput target, define whether it means typical/aggregate speed or a minimum across the tested requests. Mark unrun candidates as estimates and do not declare a quant suitable from VRAM fit alone. If asked only for an assessment, state the next discriminating benchmark without claiming it was run.

Register the skill

Project instructions make this skill discoverable inside the checkout. To make it available to Codex in other projects, register the complete repository in the user skill directory; do not copy only SKILL.md. Codex supports symlinked skill folders:

mkdir -p "$HOME/.agents/skills"
ln -s /absolute/path/to/LocalForgeLLM "$HOME/.agents/skills/localforgellm"

Use the real checkout path. Inspect an existing destination instead of overwriting it. Verify localforgellm appears through /skills or the app-server skills/list with a working directory outside the checkout; a valid symlink alone does not prove discovery. Codex detects changes automatically; restart if its catalog remains stale. Other hosts have their own discovery rules.

Registration provides the name and description for selection; the agent must still read this skill and execute its workflow. If a session already loaded SKILL.md, missing global registration does not explain skipped comparison or validation.

Keep a local stack record

Use the user's existing location and format when present. Otherwise create .local/stacks/<stack-name>/ inside this checkout when performing an actual stack task. This directory is ignored by Git. Keep the record small and concrete:

.local/stacks/<stack-name>/
  stack.json          # identities, versions, paths, endpoint and effective settings
  start.sh            # actual launch command, or reference to the managed service
  checks.md           # workload, measurements, outcomes and remaining limitations
  changes.md          # current operation, completed steps and rollback

Add a build recipe, client config or raw logs only when needed. Large weights and build trees can live on another disk; record their paths. This is a persistence convention for the agent, not a schema consumed by a hidden LocalForgeLLM daemon.

The record must contain:

Area Required information
Identity Stack name, domain, task, status, owner-selected paths
Hardware OS, CPU, GPU/backend, total and available RAM/VRAM, storage and reserved headroom
Model Source repository and revision, artifact files and hashes, architecture, format, template, projector/adapters
Runtime Source/tag/commit or package version, binary path, dependency environment, launch command and effective settings
API and clients Reachable URL from each client environment, protocol, model ID, context/output limits, capability flags, credential reference
Operation Baseline, candidate, completed steps, next step, stop/start procedure and rollback target
MTP, when requested Requested/effective mode; embedded or separate head; source revision, size and SHA-256; draft settings/placement; profile without MTP; separate download, load, quality and speed results
Validation Workload identity, date, prompt/decode timings, memory definitions, quality/tool checks and failures
Derived weights Parent revision/hash, converter/quantizer version, tensor recipe, calibration data identity, evaluation results

Store credential names or secret-store references, never credential values. Raw prompts, sessions and local paths are operational data; sanitize them before publishing a profile or benchmark.

Resume and hand off

On every subsequent request, compare the record with reality: process command, loaded model, service state, listening address, binary version and client configuration. Resolve drift before modifying settings. After an interrupted build, verify the output before reusing it; a filename does not prove a completed artifact.

Finish with the model/engine chosen, exact start/stop/connect instructions, measured results, changed files and rollback. State any unverified capability precisely. Keep the public framework generic; save the user's particular stack in its local record.