ai-llm-runtime-integration

ai-llm-runtime-integration is a skill for Claude Code, Codex from LgrappaG/Workflows-Agents. It costs 23 tokens per session (1,079 once invoked), scanned A, original, MIT.

A design guide for connecting large language models to a game at runtime, so the game can generate NPC dialogue, missions, and world content while applying safety and performance limits.

In plain words
What is it for?
Use it to connect remote or on-device models, stream dialogue, generate missions in batches, filter content and personal data, enforce token and latency budgets, limit requests, and fall back to procedural content.
Why use it?
It helps manage model failures, unsafe output, response delays, request volume, and spending in an interactive game.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lgrappag/workflows-agents/ai-llm-runtime-integration
Any agent
npx skills add LgrappaG/Workflows-Agents --skill ai-llm-runtime-integration
Clone the repo
git clone --depth 1 https://github.com/LgrappaG/Workflows-Agents

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-llm-runtime-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/lgrappag/workflows-agents/ai-llm-runtime-integration.svg)](https://agentmods.dev/skills/lgrappag/workflows-agents/ai-llm-runtime-integration)
Your own site
<a href="https://agentmods.dev/skills/lgrappag/workflows-agents/ai-llm-runtime-integration"><img src="https://agentmods.dev/badge/skills/lgrappag/workflows-agents/ai-llm-runtime-integration.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,079 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01079
Opus 5 $0.00012 $0.00540
Sonnet 5 $0.00005 $0.00216
Haiku 4.5 $0.00002 $0.00108

Measured 5d ago against content hash 99e771008d1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

ai-llm-runtime-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai-llm-runtime-integration/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ai-llm-runtime-integration

Overview

Orchestrate large language models at runtime for dynamic NPC dialogue, mission generation, and world-building while maintaining safety guardrails and performance budgets. This skill enables production-grade LLM integration in game engines with fallback strategies and measurable SLOs.

Key Capabilities

1. LLM Service Integration

  • Remote APIs: OpenAI, Anthropic, Meta, Azure OpenAI with fallback chaining
  • On-Device Models: ONNX Runtime, TensorFlow Lite for offline capability
  • Streaming Responses: Token-by-token dialogue generation for real-time character interaction
  • Batch Processing: Async mission generation with configurable QoS tiers

2. Safety & Guardrails

  • Content Filtering: NSFW, violence, PII detection at ingestion and output
  • Token Budget Enforcement: Hard limits on API spend per session/world
  • Latency Budgets: Fail-open gracefully when responses exceed SLO (fallback to procedural)
  • Rate Limiting: Per-player, per-NPC throttling with queue management
  • Jailbreak Detection: Prompt injection mitigation via semantic anomaly scoring

3. Mission & Dialogue Generation

  • Context Awareness: World state, player history, NPC personality injection
  • Deterministic Seeding: Reproduce missions for testing/replay with fixed seeds
  • Branching Narratives: Dynamic mission trees based on player choices
  • Localization: Multi-language generation with style preservation

4. Performance & Observability

  • Response Caching: LRU cache for repeated generation patterns
  • Latency Tracing: End-to-end timing from request to gameplay integration
  • Usage Analytics: Token counts, API costs, fallback rates per feature
  • A/B Testing: Variant generation for NPC dialogue quality measurement

Implementation Pattern

// Pseudo-code: High-level orchestration
class NPCDialogueGenerator : MonoBehaviour {
    public async Task<DialogueNode> GenerateResponse(
        NPCContext context,
        PlayerInput input,
        CancellationToken ct = default)
    {
        // 1. Load player history + world state
        var memoryContext = await LoadPlayerMemory(context.PlayerId);

        // 2. Build prompt with safety constraints
        var prompt = BuildPrompt(context, memoryContext, input);

        // 3. Orchestrate across providers with fallback
        var response = await LlmOrchestrator.GenerateWithFallback(
            prompt: prompt,
            maxTokens: context.TokenBudget,
            timeout: TimeSpan.FromSeconds(5),
            providers: new[] { "primary", "fallback", "procedural" }
        );

        // 4. Validate & cache result
        if (!await ValidateContent(response)) {
            response = await GenerateFallbackDialogue(context);
        }

        // 5. Record analytics
        await RecordUsage(context, response);

        return ParseDialogueNode(response);
    }
}

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 118 lines · 23 tokens per session scan A 99e771008d1e

Subscribe to this mod's changes

ai-llm-runtime-integration is a skill published in the GitHub repository LgrappaG/Workflows-Agents (2 stars, last pushed 4mo ago), licensed MIT. It adds 23 tokens to every session and 1,079 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

unity-model-agnostic-inference

Use for on-device or server inference that is not tied to one vendor model: ONNX Runtime, Sentis, Barracuda legacy, custom .onnx/.tflite/.pb assets, and swapping models without rewriting gameplay code.

rachitkumarrastogi/unity-mcp-server · 56 tokens

unity-ml-agents

Use when working on Unity ML-Agents: training configs, BehaviorParameters, sensors, actuators, inference in builds, or com.unity.ml-agents packages.

rachitkumarrastogi/unity-mcp-server · 39 tokens

unity-llm-integration

Use when adding LLM/chat/RAG features to a Unity game or tool: API keys, prompt assets, safety, latency, and server-side vs client-side calls.

rachitkumarrastogi/unity-mcp-server · 41 tokens

unity-sentis-inference

Use when integrating ONNX/Sentis/Unity Inference in Unity: model assets, IWorker, runtime performance, or com.unity.sentis packages.

rachitkumarrastogi/unity-mcp-server · 39 tokens

iflytek-image-understanding

Use when user asks to analyze an image, describe image contents, or answer questions about a picture. iFlytek Image Understanding (图片理解) — analyze and answer questions about images using Spark Vision model. WebSocket API, pure Python stdlib, no pip dependencies.

iflytek/iFly-Skills · 61 tokens

skill-creator

Create or improve Zhin Agent skills (SKILL.md). Use when asked to add a skill, write SKILL.md, document a repeatable agent workflow, or refine skill frontmatter/keywords. Triggers: 创建技能, 写 SKILL, skill-creator, 加 skill.

zhinjs/zhin · 61 tokens