Lightweight LLMs Compared Across Seven Tasks: Agent and Coding Benchmarks

    A side-by-side evaluation of ten representative lightweight models on seven developer-oriented tasks, under a shared calling setup and scoring rubric, focused on multi-step personal agents and coding assistance.

    1. Why Compare Multiple Lightweight Models on the Same Tasks

    In recent years, vendors have released smaller, cheaper, and faster “lightweight” model variants (often branded with suffixes such as Flash, Mini, or Turbo, with naming differing by vendor). Their positioning is highly consistent: very low latency and cost for high-frequency workloads such as personal agents, batch text processing, and coding assistance.

    The problem is that official capability claims are hard to compare directly. Evaluation methods, context lengths, and calling conventions differ. For developers, the only judgment that really matters is this: run them on the same tasks, the same prompts, and the same execution environment, then look at the results.

    This article is a full record of that approach. Ten representative lightweight models on the market were selected (for neutrality, they are referred to below as M1 through M10) and compared across seven tasks close to real development work. The comparison focuses on two questions:

    1. In a personal agent setting, which models more reliably complete multi-step tasks?
    2. In a coding assistance setting, whose generated code is more dependable?

    2. Evaluation Design: Set the Rules Before the Race

    Any head-to-head comparison without a shared standard produces conclusions that do not hold up. The evaluation framework therefore had to be built before any tasks were run.

    2.1 A Shared Calling Environment

    • Access method: All models were called through OpenAI-compatible HTTP APIs (a de facto industry protocol; most vendors provide a compatibility layer) so request structure stayed consistent.
    • Inference parameters: temperature was fixed at 0.7, and max_tokens used a shared cap by task type, so differences in generation length would not create an unfair edge.
    • Retries and timeouts: Timeout and failure-retry settings were the same for every model. Success rate was measured, not only the subset of runs that happened to finish.

    One way to wrap the calls looks like this:

    1. import openai
    2. def call_model(model_name: str, messages: list, max_tokens: int = 2048):
    3. client = openai.OpenAI(base_url=BASE_URL[model_name], api_key=KEYS[model_name])
    4. return client.chat.completions.create(
    5. model=model_name,
    6. messages=messages,
    7. temperature=0.7,
    8. max_tokens=max_tokens,
    9. timeout=60,
    10. ).choices[0].message.content

    2.2 Scoring Dimensions

    Each task was scored on four dimensions:

    Dimension Description
    Task completion Whether a usable result was produced and the required function was met
    Accuracy Share of correct answers when a clear correct answer exists
    Code runnability For coding tasks, first-pass success rate and number of fix rounds
    Response time End-to-end latency, including time to first token and total duration

    3. Seven Tasks and What the Results Showed

    Task 1: Character Information Retrieval (Agent Baseline)

    The model was given a fictional setting (for example, a character in an original world called “Spirit Corridor”) and asked to return the character’s name, identity, relationship graph, and related fields against a fixed JSON schema. When information was uncertain, it had to output not_found rather than invent details.

    What it tests: Adherence to structured output and resistance to hallucination.

    Findings: Most models could emit valid JSON, but the gap was large on “say you do not know when you do not know.” Stronger models stuck to the placeholder; some tended to fill in missing fields. Clear prompt constraints (such as few-shot positive examples) were needed to bring hallucination down. Overall, the ability to refuse fabrication is the first filter when choosing a lightweight model as a personal agent base.

    Task 2: Comment Sentiment Classification

    A batch of noisy real user comments (including sarcasm, emoji, and abbreviations) was labeled positive, negative, or neutral and compared with human annotations.

    What it tests: Robust semantic understanding and stability under batch processing.

    Findings: This task is generally friendly to lightweight models. Accuracy mostly sat in an acceptable range, but the difference showed up on extreme samples. Sarcastic comments were the strongest separator; weaker models were easily misled by surface tone. Some models also drifted in format on long batches (for example, dropping the category field partway through), so the parser needs to tolerate errors.

    Task 3: Data Collection and Statistics

    Given a description of a data API, the model had to write a fetch script and produce a statistical summary (the kind of general data task illustrated by “analyze popular content traits under a topic on a video platform”).

    What it tests: Turning a natural-language requirement into executable code.

    Findings: Quite a few models could write a syntactically correct script on the first try, but far fewer handled engineering details such as pagination, exceptions, and missing fields. This again supports a practical rule: lightweight models are a good fit for a first draft; complex business logic still needs a human to finish it.

    Task 4: Localizing a Website into Chinese

    Given the source of an English static page, the model had to translate interface copy into Chinese while leaving the HTML structure intact and the layout unbroken.

    What it tests: Long-context retention and constraint following.

    Findings: This was one of the tasks that separated models most clearly. Stronger models translated block by block without touching tag structure. Weaker models often reordered the DOM on their own, skipped sections, or translated code comments as well, which did not break the page but left it messy. Scoring should use an automated DOM diff rather than a subjective read.

    Task 5: Science Explainer Animation Scripts

    Given a science topic, the model had to produce an animation script with storyboards, narration, and subtitles in a preset template.

    What it tests: Combining creativity with structured output.

    Findings: On this more open-ended task, lightweight models were relatively even. Scientific accuracy matters more than prose style. A few models produced plausible-sounding but shaky scientific details, so fact-checking by someone with domain background is worth building into the review.

    Task 6: Parametric 3D Turret Modeling

    The model had to turn a text description into parametric construction code for a 3D model (for example, a Python script using a general modeling approach) that would render the intended turret shape.

    What it tests: Spatial reasoning closed with code execution.

    Findings: This was both the hardest task and the one with the largest spread. Most lightweight models produced geometry that only “looked roughly right,” with large differences in proportion and structural plausibility. If a use case depends on spatial or geometric reasoning, test it on your own real examples. Generic benchmark scores are not enough.

    Task 7: Multi-Agent Collaboration (“Spirit Corridor” Multi-Character Simulation)

    A simple environment with several character agents was set up. Different models drove different characters through multi-turn dialogue, and the question was whether the scenario could reach the expected state within a fixed number of turns.

    What it tests: Multi-turn context management, character consistency, and stable instruction following.

    Findings: A model that looks strong in a single turn is not necessarily stable across many turns. Common failures included voice drift, forgetting early constraints, and ending the conversation too early with a summary. When choosing a personal agent base, include a dedicated test centered on multi-turn consistency.

    4. How to Choose a Lightweight Model

    Across the seven tasks, a few conclusions travel well:

    1. There is no all-around winner. Rankings on more deterministic tasks such as classification and localization overlap little with the top two on reasoning-heavy work such as 3D modeling. That is the clearest argument for judging by scenario rather than by a single score.
    2. Agents need stability; coding needs accuracy. For an agent base, prioritize instruction following and multi-turn consistency. For a coding assistant, prioritize first-pass success and completeness of engineering detail.
    3. Hallucination control is the dividing line. On information-retrieval tasks, models willing to stay uncertain are more trustworthy.
    4. Cost and latency still matter. Even among lightweight models, response-time gaps are large. For high-frequency calling, latency should be part of the scoring formula.

    The most practical move for a developer is to take this method home: turn your own real work into five to seven small tasks that can be scored automatically, write one shared calling and scoring script, and rerun it whenever a new model ships. Choose with data, not reputation.