Small Language Models and Agent Skills: An Engineering Path to Local AI Agents
This article examines whether the Agent Skills framework, designed for very large models, can be applied to small open-source language models (SLMs) deployed locally. It formalizes skill execution as a partially observable Markov decision process (POMDP), reports evaluation results across models from 270M to 80B parameters, and offers guidance on model selection, routing, and skill design under limited hardware budgets.
1. Background: Core Challenges of Local Agents
As large language models have shown strong capabilities on complex tasks, the Agent Skills framework has become a key approach for improving task completion. Its core idea is to decompose complex tasks into reusable, composable skill modules. At inference time, the model dynamically selects and invokes the appropriate skills to handle multi-step, multi-tool interactions.
A practical question follows: can this skill orchestration system, designed for very large models, be transferred to open-source small language models (SLMs) deployed locally with limited parameter counts? Under the combined constraints of compute cost and data privacy, local deployment has become a requirement for many enterprises. Small models, however, have inherent limits in context window size, reasoning depth, and instruction following. These limits make migrating the Agent Skills framework a significant challenge.
To turn this intuitive, black-box judgment into quantifiable, optimizable engineering metrics, the Agent Skills runtime must be reformulated from a mathematical foundation. Comparative tests across the full range of model sizes can then answer a simple but critical question: under a limited hardware budget, which model size and routing strategy can be combined into a local agent that is actually usable?
2. A POMDP-Based Formal Definition of Agent Skills
To evaluate and optimize system behavior precisely, the researchers abstract the Agent Skill system as a constrained controller. The controller performs information-seeking tasks in a partially observable world. At each decision step, the agent must balance task progress against limited context resources. It then chooses one of three actions:
- Submit and execute a skill: Directly invoke a selected skill to complete a sub-task.
- Reveal more information: Expand the current skill or its referenced resources in greater depth. This action acquires additional observations at a computational cost.
- Take direct environment actions: Execute tool calls or other actions in the environment without going through the skill abstraction.
The underlying system follows Markov dynamics, but the agent cannot directly observe the true global state, such as user intent, task progress, or environment facts. This makes the process a natural fit for a partially observable Markov decision process (POMDP). The model includes an explicit information-gathering action. The agent can trade extra computation, such as expanding the context window or loading more documents, for a more precise view of its current state.
2.1 Skill as a Triplet
Under this framework, any skill is defined as an abstract triplet:
- Text descriptor: The skill’s name and textual description. The model uses it to index and select skills quickly.
- Internal policy: A temporally extended, within-skill policy. It is an option-level process or workflow that produces a sequence of actions and describes how the skill runs step by step once selected.
- Reference mechanism: Formalized as a Markov kernel. It reveals additional skill-related context and tools, and it can contain pointers to other skills. This mechanism is the mathematical basis for skill composition and dynamic expansion.
2.2 POMDP State Space and Belief State
The core elements of the POMDP are defined as follows:
- State S: The hidden task situation, including user intent, task stage or progress, and environment facts that have not been retrieved.
- Observation O: What the agent can access at time step t, including the current user message, available conversation history, and any resources or skills that have been revealed or loaded.
- Action A: Skill selection, costly context acquisition, skill execution, and environment or tool calls. It also covers internal planning and reasoning actions.
- Belief state: The posterior probability distribution over the current true state, given the agent’s history of observations and actions. The belief state guides decisions under partial observability. It also links information-gathering actions to task returns.
By introducing costly context acquisition as an action, the POMDP framework explicitly includes the finite context window, an engineering constraint, in the optimization objective of the probabilistic graphical model. This matters most for local small models, whose context capacity is far smaller than that of cloud-hosted large models. Balancing the risk of consuming context too early against the risk of making decisions with insufficient information becomes a first-order problem in system design.
3. Full-Spectrum Model Evaluation: Method and Key Findings
To test the framework’s generality and limits, the researchers designed an evaluation covering models from 270M to 80B parameters. They selected an industrial-grade dataset that is close to real business scenarios for stress testing. This approach avoids purely academic, simplified tasks, so the conclusions can inform practical deployment.
3.1 Model Spectrum and Task Design
The evaluated model pool spans the full range from very lightweight models (hundreds of millions of parameters) to near-flagship models (tens of billions of parameters). The tasks include multi-hop information retrieval, tool call sequence generation, and dynamic plan correction. These scenarios contain uncertainty and distractors. They simulate practical industrial problems such as obscured information, low signal-to-noise ratio, and goal drift.
3.2 Core Evaluation Dimensions
The evaluation measures task completion rate and breaks down performance along the following dimensions:
- Context utilization efficiency: The number of context tokens consumed per unit of task progress. This metric reflects how well the model balances information gathering against task execution.
- Skill invocation accuracy: The proportion of cases where the model selects the correct skill at the right time, and how stably it executes the skill’s internal workflow.
- Failure recovery: Whether the model can update its belief state and replan based on observations when a skill fails or the environment interrupts execution.
3.3 Key Findings
The comparative results point to several practical rules for local deployment:
First, there is a clear capability threshold. For tasks of a certain complexity, models with very small parameter counts (in the millions) struggle to invoke skills effectively, even when the skill definitions are well designed. Their instruction-following ability cannot sustain multi-step workflows, and they often lose track midway through a task. When the parameter count reaches a certain scale, such as 20B or above, task completion rate rises in a step-like fashion. For local deployment, this means there is a sweet spot. Bigger models are not always better. Teams need to balance GPU memory usage, inference latency, and task pass rate.
Second, the context reveal strategy sets the ceiling for small models. When the context window is limited, the timing of costly context acquisition directly affects success rate. The experiments show that a simple heuristic gate can noticeably improve a small model’s resistance to interference. For example, the system can automatically expand context when the probability of the goal state in the belief state falls below a set threshold. This supports the POMDP principle of paying an extra cost for better observations in a practical system.
Third, routing robustness matters more than the size of the skill library. Rather than endlessly expanding the skill library, a lightweight routing model that accurately decides whether to use a skill, and which one to use, yields a larger benefit. In multi-task scenarios with interference, the cost of incorrect routing far outweighs the performance differences between individual skill implementations.
4. System Configuration Recommendations for Local Deployment
Based on the theoretical analysis and measured results above, a constrained hardware budget (for example, a single consumer GPU or an edge device) can support a usable local agent if the following configuration principles are applied.
4.1 Model Selection: From Parameter Race to Capability Matching
- Purely lightweight tasks (such as single-turn Q&A or simple information extraction): Models in the hundreds of millions of parameters, paired with carefully designed prompt templates, can handle these tasks.
- Multi-step tool calling (such as database queries or chained API calls): Prioritize high-quality open-source models in the 20B to 30B range. This range offers a good balance between decision quality and VRAM cost.
- Extremely complex, long-horizon tasks (such as automated workflow orchestration): If hardware allows, let the local agent handle upstream decomposition and planning. Then use a lean cloud interface to complete the parts of the task that require strong generalization.
4.2 Routing Strategy: Belief-Driven Dynamic Selection
Avoid using a static intent classifier to decide whether to invoke a skill. Instead, build a dynamic threshold mechanism based on the POMDP belief state. Before each step, the model assesses whether the current information is sufficient to support the next action. If information entropy is high and a context expansion action is available, the model should invoke that action proactively. Compared with traditional fast classification, this uncertainty-driven routing consumes more compute. However, it performs more reliably on industrial data with incomplete information.
4.3 Atomic Skill Design
In local deployments, skills should stay atomic. Each skill should perform one minimal business action that cannot be subdivided further. Long workflows should be chained through the skills’ reference mechanism, rather than packaged into one large, indivisible black box. This design helps the model complete its reasoning within a limited sequence length. It also enables graceful degradation: when a single skill fails, the system can recover by replacing or skipping that skill.
5. Conclusion and Outlook
Migrating the Agent Skills framework to local small models requires systems engineering that rethinks how mathematical modeling, hardware constraints, and task characteristics relate to one another. The value of the POMDP framework lies in elevating the question of when to acquire information, an engineering detail often overlooked, to the same level of importance as task strategy. For developers, two priorities matter more than chasing larger parameter counts. First, build a highly cohesive library of atomic skills for the target domain. Second, design a decision core that can sense its own uncertainty and knows when to look for more information and when to act.
As model quantization and inference acceleration engines continue to improve, the capability gap between local agents and cloud-hosted large models may narrow. Skill management methods grounded in rigorous probabilistic graphical models could become a foundation for the next generation of local agents that are reliable, explainable, and auditable.
