Choosing an Open-Source LLM in Practice: Reasoning, Function Calling, and Multimodal Support
A practical guide to choosing among open-source models from 2B to 31B parameters. It covers the capability limits of each size, a selection table, implementation tips for function calling, a pre-launch checklist, and the main terms of the Apache 2.0 license.
Most teams first ask which model is the strongest. A more practical question is which model gives the best value under their own compute and business conditions. This generation of open models comes in four sizes: 2B, 4B, 26B mixture-of-experts (MoE), and 31B dense. That gives teams more room to choose. This article explains the capability limits of each size by use case. It also provides a selection table, implementation notes for function calling, a pre-launch checklist, and key licensing points.
The specifications and capability descriptions here are summarized from release materials. For exact model names, version numbers, and parameter details, refer to the official model cards and release documentation, and verify each item before launch.
Which Use Cases Fit Each Size?
The table compares typical use cases and deployment considerations for each size. Where the context window or multimodal support is not listed here, refer to the official model card.
| Size | Typical Use Cases | Context Window | Multimodal Input | Deployment Notes | Cost Risk |
|---|---|---|---|---|---|
| 2B | Smartphones, IoT devices, offline assistants | 128K | The on-device variant is noted to support audio. Refer to the official model card for other inputs. | Test the stability of complex reasoning and long code generation separately. | Low resource use, but a lower capability ceiling |
| 4B | On-device voice interaction, medium-length document processing | 128K | Same as 2B | Same as 2B. Suited to on-device scenarios that need more capability than 2B. | Lower resource use than cloud-scale large models, but complex tasks require additional testing |
| 26B MoE | Customer support Q&A, content moderation, moderately complex analysis | Refer to the official model card | Refer to the official model card | Only some experts are activated per inference, but all weights must be loaded into GPU or system memory. | Lower compute than a dense model with the same total parameters, but a substantial memory requirement for deployment |
| 31B dense | R&D assistance, technical document parsing, high-value analysis | 256K | Refer to the official model card | The full network is activated for each inference, which requires substantial compute. | Highest inference cost, but usually more stable on complex tasks |
Selection should not rely on active parameter count alone. MoE models need less compute per inference, but memory must hold all of the weights. Measure memory usage at your actual precision and context length. Measure throughput and cost per call under your own workload. Do not apply published figures directly.
How Should Reasoning Be Verified?
Reasoning claims should be checked against your own tasks. Public benchmarks may use different questions, scoring criteria, and prompt formats from your business scenario, so do not rely on leaderboard rankings alone.
Use the following steps:
- Sample at least 200 examples from real business data, stratified into easy, medium, and hard tiers. Record the share of each tier.
- If the samples have definitive answers, score them with automated comparison. If not, write a scoring rubric, have two reviewers score independently, and calculate their agreement.
- Fix the temperature, random seed, and prompt template so comparisons across sizes are fair.
- Record accuracy, average response time, and cost per call together.
With 200 samples and an accuracy near 50%, the 95% confidence interval is roughly ±7 percentage points. If the gap between two sizes is smaller than that range, do not conclude that one performs better.
Multi-step planning is a key area of improvement in this generation. To test it, design questions that must be broken into stages. For example: “After a new metro line opens in a city, how will residents’ commuting carbon emissions change?” Check whether the model lists the relevant factors, reasons in chronological order, and supports its conclusions with evidence. Do not treat the model’s reasoning steps as reliable conclusions on their own. Have a person review key results.
Test code generation with real functions from your project. Ask the model to complete a function or convert it to another language, then run unit tests. Pass rates are a more reliable measure than subjective impressions.
How Can Function Calling Run Reliably?
Function calling lets the model decide when an external tool is needed. In a weather query, for example, the model first interprets the user’s question. It then generates a call that meets the parameter constraints. Finally, it turns the JSON returned by the API into a natural-language reply. Reliability depends on three things: clear function descriptions, strict parameter validation, and thorough error handling.
The following is a JSON Schema for a weather lookup tool:
{"name": "get_weather","description": "Get the 24-hour weather forecast for a specified city. The city name must be the full Chinese name or the full pinyin.","parameters": {"type": "object","properties": {"city": {"type": "string","description": "City name, for example 北京 or Beijing"},"unit": {"type": "string","enum": ["celsius", "fahrenheit"],"description": "Temperature unit"}},"required": ["city"],"additionalProperties": false}}
Setting additionalProperties to false prevents the model from generating undefined parameters. The model relies mainly on description fields to decide how to fill in parameters, so each description should state the valid values clearly.
Tool calls can be handled with the following flow:
function handle_tool_call(call):if call.name not in ALLOWED_TOOLS:return error("Tool not authorized")args, err = validate_against_schema(call.args, schema[call.name])if err is not null:if retry_count >= 2:return error("Invalid arguments after repeated attempts. Escalate to human review.")retry_count = retry_count + 1return request_regenerate(err)if not user_has_permission(current_user, call.name):return error("Permission denied")result = call_with_timeout(call.name, args, timeout=5s)if timeout or result.status >= 500:return fallback_response()return result
The flow has several key points. Tool names should be on an allowlist. Arguments must pass schema validation, and model output should never be trusted directly. If validation fails, let the model regenerate at most twice, then escalate to a human or degrade the service. Permission checks must run before execution. Timeouts and errors need a clear fallback path. The fallback message should tell users that the service is temporarily unavailable, rather than letting the model guess a result.
Parallel and nested calls make troubleshooting harder. Log the request, parameters, response, and duration of every call, and assign IDs by call chain. Parallel calls also need an overall timeout and a concurrency limit, so the services behind the tools do not get overloaded.
What Are the Limits of Multimodal and Long-Context Support?
Not every model in the series supports the same input types. The source notes that on-device models accept audio input. Which models accept image or video input should be confirmed in the official model card. In industrial quality inspection, a model that accepts images can combine equipment images with operation logs to suggest diagnoses. However, image recognition accuracy depends on capture conditions and on how well the training data covers the target scenarios, so test with your own samples.
Long context expands how much text a model can process in one pass. The flagship model supports a 256K context window, and the on-device models support 128K. Token-to-character conversion depends on the tokenizer. As a rough guide, one token corresponds to about one Chinese character. This is only an order-of-magnitude estimate, not a fixed rule. 256K tokens is not a fixed number of words, so measure actual text with the target tokenizer.
Even with long context, do not feed in all materials without filtering. Long inputs increase latency and cost. Information in the middle of a long input is also more likely to be overlooked. Common practice includes:
- Split documents into segments, build an index, and include only the relevant segments in context.
- For long documents such as contracts, have the model list the clauses first, then check them for consistency one by one.
- Keep source quotations for key conclusions so people can verify them.
Pre-Launch Checklist
Confirm each item before launch:
- Tool names are on an allowlist.
- Every tool has a JSON Schema, with
additionalPropertiesset tofalse. - User permissions are checked before any tool runs.
- Timeouts and 5xx errors have fallback messages, and the model does not fabricate data.
- Parallel and nested calls have an overall timeout and a concurrency limit.
- Each call logs its request, parameters,
