Can Small Models Power a Local Skill-Based Agent Framework?
This article examines whether skill-based agent frameworks can run effectively on small language models (SLMs) deployed locally instead of relying on large closed-source APIs. It formalizes a skill system as a POMDP, explains why explicit context budgeting, searchable skill granularity, and approximated belief states favor smaller models, summarizes model-size selection findings from 270M to 80B, and provides engineering conventions for skill descriptions, reference mechanisms, layered routing, evaluation metrics, and deployment. Readers will learn how to build a compliant, controllable, and cost-predictable agent system on local hardware.
1. Background: Why Skill-Based Agents Need to Move Down to Local Small Models
Over the past two years, the skill-based design paradigm for agents has become an industry consensus: complex tasks are decomposed into reusable capability units, each carrying a name, a description, and an expandable execution flow that the model loads on demand during reasoning. These frameworks perform well on general-purpose large models with strong reasoning ability, but engineering deployment exposes a structural contradiction — the approach depends so heavily on model capability that the solution ends up bound to very large closed-source APIs.
In scenarios such as financial risk control, energy dispatch, and confidential data analysis, data cannot leave its domain, calls must be auditable, and costs must be predictable. Solutions that continuously depend on external APIs often get blocked at both the compliance review and the budget review. So a genuinely valuable engineering question is: can a skill-based framework be migrated to small language models (SLMs) that run locally, while retaining most of its benefits?
The difficulty is that small models have narrower context windows, weaker instruction following, and a greater tendency to drift during long-horizon planning. If you keep the naive practice of stuffing all skill descriptions into the prompt, a small model is quickly overwhelmed by redundant information. To answer the question, “skill” must first be abstracted from an engineering habit into a measurable mathematical object.
2. Formal Modeling: Writing the Skill System as a POMDP
The key abstraction is this: a skill-based agent is not an omniscient planner, but a constrained controller performing information search in a partially observable environment. At every step it must trade off between advancing the task and consuming a limited attention/context budget. Its available actions fall into three categories: submit and execute a skill, reveal a skill or more details of what it references, or act directly in the environment.
Because the underlying environment evolves in a Markovian way while the model only sees local information, the system is naturally modeled as a partially observable Markov decision process (POMDP), with “information acquisition actions” introduced explicitly — paying a context cost in exchange for a better observation.
A skill can be abstracted as a triple:
- Identifier and description: the skill name and text description, the main basis for the model’s retrieval and selection;
- Temporal policy: an internally extended process over time, i.e., the sequence of actions triggered once the skill fires (an option-level process);
- Reference mechanism: a structure that can reveal additional context, tools, or even pointers to other skills, formalized as a Markov kernel.
The corresponding POMDP elements can be written as:
- State S: the hidden task situation, including the user’s true intent, the task stage, and environment facts not yet retrieved;
- Observation O: the current message, history fragments, loaded resources, and skills;
- Action A: skill selection, paid context acquisition, skill execution, environment/tool calls, and internal reasoning;
- Belief state b: the posterior estimate of S based on historical observations and actions.
The engineering value of this modeling is that it turns the vague question of “how well the prompt is written” into an optimizable question of “how to maximize expected return under a budget constraint.” Skill granularity, how detailed descriptions are, and when to expand a reference all become tunable parameters rather than guesswork.
3. Why Small Models Need This Formalization More
Large models can compensate for missing descriptions with implicit knowledge in their parameters. Small models cannot. The formal framework happens to offer three engineering levers that are friendly to small models.
First, explicit context budgeting. Treating each “reveal details” step as an action with a cost forces system designers to actively compress the resident context, keeping only a skill index and loading the body on demand. For a small model with a limited window, this is both a hard constraint and a performance guarantee.
Second, searchable skill granularity. The triple definition means skills can be split, merged, and reordered. In practice you can run small controlled experiments across different granularities to find the “minimum executable unit” that a small model follows reliably, avoiding instruction drift caused by packing too many branches into one skill.
Third, approximable belief state. Small models struggle to maintain long-horizon memory, so an external structured state (task stage markers, list of loaded skills, failure counts) can approximate the belief state, moving “memory” from inside the model to auditable external storage — improving stability while meeting compliance audit needs.
4. Model Size Selection: Lessons from 270M to 80B
Controlled experiments spanning the full spectrum of open-source models, from hundreds of millions of parameters to just under a hundred billion, point to a pragmatic conclusion: the skill-based framework works for small models too, but the magnitude of the benefit correlates positively with model size, and there is a clear “capability threshold effect.”
Actionable selection guidance:
- Very small models (hundreds of millions of parameters): suited to narrow tasks such as intent classification, routing, and format conversion; not suited to multi-step planning;
- Small and mid-size models (billions of parameters): with good skill descriptions and strict budgets, can complete most single-chain tasks, making this the cost-effective range for localization;
- Large models (tens of billions of parameters and above): can handle complex long-horizon tasks, but hardware cost rises, so they should be used only for hard samples that routing selects.
The key design is layered routing: a lightweight discrimination step judges sample difficulty, simple requests are executed directly by a small model, and hard requests are escalated to a large model or trigger an additional information acquisition action. Under a limited hardware budget, overall throughput and the cost curve are significantly better than “handing everything to the largest model.”
Illustrative pseudocode:
def decide(obs, belief, budget):if budget.remaining() <= 0:return Action.act_direct(obs)if difficulty(obs) < THRESHOLD:return Action.skill_select(light_model.route(obs))if belief.unknown_ratio() > 0.4:return Action.acquire_context(pay=1) # paid observationreturn Action.skill_select(heavy_model.route(obs))
5. Engineering Conventions for Skill Descriptions and Reference Mechanisms
To turn the formal definition into code, you need an executable set of conventions:
- Description as retrieval key: the name and description should include the triggering scenario, preconditions, and cases where it does not apply, so a small model can match accurately;
- Stepwise and interruptible flows: split the internal policy into numbered steps, each with a checkpoint, so a failure can roll back instead of retrying the whole thing;
- References expanded on demand: the reference mechanism exposes only pointers and summaries, with the body loaded lazily to control resident context;
- Unified tool-call abstraction: describe environment actions with a common interface for input and output schemas, reducing format errors from small models;
- Externalized state: write the task stage and loaded-skill list to external storage so the system can recover after a restart and remain auditable.
6. Evaluation and Deployment Recommendations
Evaluation should go beyond “final answer accuracy” and cover at least four metrics: task success rate, context consumption (equivalent to cost), average number of decision steps, and out-of-bounds/hallucination rate. Stratified statistics on real industrial datasets are what reveal the marginal benefit of scale and routing strategies.
On the engineering side: prioritize containerized deployment to isolate dependencies, use object storage for the skill library and datasets, use a message queue to decouple long-running tasks, and use logging services plus monitoring and alerting to track every action and budget consumption, forming a traceable closed loop. If cloud resources are used, combining general-purpose capability categories is enough to meet elasticity and observability needs.
The conclusion is clear: skill-based agents are not exclusive to large models. With POMDP-style formalization that explicitly models skills, context cost, and belief state, plus layered routing and strict budgets, local small models can be assembled into a usable agent system that is compliant, controllable, and cost-predictable.
