Selecting Open-Source Large Language Models: A Guide to Licenses, Costs, and Deployment
This article provides a comprehensive guide for selecting and deploying open-source large language models (LLMs). It covers the distinction between open weights and true open source, compares common license types, breaks down private deployment costs, and outlines compliance risks. Additionally, it offers a practical five-step framework for model evaluation, routing, and secure AI Agent deployment.
1. Distinguishing “Open Weights” from “Open Source”
In discussions about open-source LLMs, the term “open source” is frequently misused. Some teams only release model weights, allowing downloads, inference, fine-tuning, and redistribution, but keep training code and data private. Others release full training details and evaluation methods. For users, the difference is significant. With only weights, you can deploy and fine-tune the model, but you cannot reproduce the training process or verify data provenance.
In 2024, the Open Source Initiative (OSI) released version 1.0 of the Open Source AI Definition (OSAID), requiring that open-source AI systems provide modifiable code, model parameters, and information about training data. By this standard, most “open weight” models do not qualify as fully open source. When evaluating whether a model is truly “open source,” it is recommended to review the LICENSE file and official technical report in the repository, rather than relying solely on marketing copy.
Recently, several teams have released weights for larger-scale models and introduced new versions with improved instruction following, long-context understanding, and multi-step task capabilities. When referencing these advancements, verify the model name, release date, official technical report, parameter scale, evaluation conditions, and applicable use cases. Leaderboard scores can fluctuate significantly depending on the evaluation dataset and prompts, so this article does not rank specific models.
2. Three Questions to Answer Before Choosing a License
The license is the first checkpoint when using an open-source model. During selection, ask three questions: Is commercial use allowed? Are there thresholds for user count, revenue, or API calls? Are specific industries or use cases restricted? The table below summarizes the differences between three common license types.
| License Type | Commercial Use | Attribution & Retention | Patent Terms | Considerations |
|---|---|---|---|---|
| Apache 2.0 | Allowed | Retain copyright notices and license text; state changes | Explicitly grants patent license | Suitable for internal enterprise use and external products |
| MIT | Allowed | Retain copyright notices and license text | No explicit patent terms | Brief terms, but offers no patent-level protection |
| Community License | Varies | Usually requires citing the model source | Varies | May include user thresholds, prohibited uses, or geographic restrictions |
Community licenses vary the most. Some restrict using model outputs to train other models, while others require additional authorization if user volume exceeds a certain threshold. The table above is a general summary; always refer to the LICENSE file and usage policy in the model repository. Before signing contracts or going live, have legal or compliance teams verify the exact terms.
3. Calculating Private Deployment Costs
The cost of private deployment consists of four components: compute resources, storage and networking, human maintenance, and security and compliance review. Compute resources are usually the easiest to estimate but also the most frequently underestimated.
VRAM is the first constraint. When model weights are stored in FP16 format, each parameter occupies approximately 2 bytes. For a 7-billion parameter model, the weights require about 14GB of VRAM; for a 70-billion parameter model, about 140GB. If a quantized format like INT4 is used, each parameter takes about 0.5 bytes, reducing VRAM requirements to roughly a quarter of the original. Additionally, the KV cache during inference grows with context length and concurrency, meaning actual VRAM requirements are typically higher than the weights alone.
Throughput and latency are the second constraint. During selection, test the generated tokens per second and time-to-first-token under target concurrency, then estimate unit cost using the following formula:
Unit Cost = Hourly Hardware Cost ÷ (Tokens per Second × 3600) × 1,000,000
This formula yields the compute cost per million tokens and does not include human and failure costs. If your business traffic has significant peaks and averages, you must provision resources for peak loads or design an elastic scaling solution.
Human costs are often overlooked. Model upgrades, inference framework adaptation, security patches, and monitoring alerts require dedicated maintenance. Small teams should prioritize mature inference service frameworks to reduce custom development efforts.
4. Commercial Boundaries and Compliance Risks
Compliance risks primarily fall into four categories.
The first is license compliance. Beyond thresholds and attribution, confirm whether model derivatives can be distributed as closed-source, and whether fine-tuned weights must retain the original license.
The second is data compliance. Data used for fine-tuning must have legal sources and usage authorization. When dealing with personal information, comply with data privacy regulations (e.g., GDPR or local equivalents), and implement proper data masking and access control during collection, storage, and transmission.
The third is content compliance. If providing generative AI services to the public, pay attention to regulatory requirements for generative AI services, including content safety moderation, user complaint handling, and regulatory filings or registrations.
The fourth is export control. Certain chips, encryption technologies, and model-related technologies are subject to export controls. For cross-border deployments or transferring models to overseas partners, consult relevant regulations first.
Furthermore, LLMs can still produce factual errors and biased outputs. For high-risk scenarios such as healthcare, legal, and finance, retain a human review process and do not use model outputs directly as final decisions.
5. Practical Implementation: From Evaluation to Agent Deployment
The first step is to break down business scenarios. Code completion is latency-sensitive, while financial report analysis requires long context and stable numerical computation. Clarify the input format, output format, and fault tolerance requirements of the task before deciding on a selection direction.
The second step is to build a private evaluation set. Public leaderboards serve only as reference baselines. Enterprises should first collect 200 to 500 real business samples covering common queries and edge cases, have two annotators label them independently, and calculate consistency metrics. The sample distribution should closely match live traffic.
The third step is to design evaluation metrics. Offline evaluation can focus on accuracy, output format compliance rate, rejection rate, P95 latency, and cost per task. Before launch, conduct small-traffic online A/B testing to observe user satisfaction and manual modification rates.
The fourth step is to design model routing. Simple tasks can be routed to a quantized small model, while complex tasks are handled by a large model. Routing accuracy directly impacts costs, so evaluate the router’s false positive rate separately. Speculative Decoding can reduce the generation latency of large models, but the benefit depends on the acceptance rate between the draft model and the target model; test and compare under the same batch size.
The fifth step is to wrap the Agent and control permissions. When an Agent accesses databases, files, or business systems via function calls, adhere to the following principles: grant tools minimum privilege, defaulting to read-only; require human confirmation for write operations; log all call records into an audit log; have a clear fallback strategy for timeouts and failures; and mask data sent to the model beforehand.
The following pseudo-code illustrates the structure only and is not intended for production use:
# Illustrative only: Minimal framework for task routing and tool calling, not for productionALLOWED_TOOLS = {"search_docs", "read_log"} # Tool whitelist, read-only by defaultdef route_task(user_input: str):if is_simple_query(user_input):return call_small_quantized_model(user_input)return call_large_model(user_input)def run_agent_step(tool_name, args, audit_log):if tool_name not in ALLOWED_TOOLS:audit_log.append(("denied", tool_name))raise PermissionError(f"Tool not authorized: {tool_name}")audit_log.append(("call", tool_name))try:return execute_tool(tool_name, args, timeout=10)except TimeoutError:audit_log.append(("timeout", tool_name))return fallback_answer()
6. Conclusion and Action Checklist
Open-source LLMs lower technical barriers, but licensing, cost, and compliance issues do not disappear simply because the model is open source. Before selection, it is recommended to proceed in the following order: confirm licenses and commercial thresholds; test throughput and latency on target hardware; compare candidate models using a private evaluation set; complete data and content compliance reviews; and pilot Agent deployment with read-only permissions first.
As multimodal capabilities and tool-calling protocols (such as MCP) are adopted by more toolchains, the effort required to integrate models into external systems may decrease further. Whether this trend continues depends on actual adoption by various platforms, so it is advisable to rely on hands-on testing results.
