The best open source LLM overall, as of August 2026, is Kimi K3: 88.3 on Terminal-Bench 2.1, 81.2 on FrontierSWE, 2.8T total parameters with 104B active, 1M context, weights published July 27, 2026. GLM-5.2 is the strongest model under a plain MIT license at 62.1% SWE-bench Pro. DeepSeek-V4-Pro resolves 80.6% of SWE-bench Verified, also MIT. Qwen3.6-27B gets 77.2% from a dense 27B that runs on one GPU. Most of these are open-weight, not OSI open-source. Morph serves several of them on its fleet through one OpenAI-compatible API.
The Best Open Source LLMs, Ranked
This page ranks the best open-weight LLMs, models with downloadable weights you can self-host. If you want the overall coding ranking including proprietary frontier models (Claude, GPT, Gemini), see best LLM for coding. Below is the ranked open-weight shortlist for general and coding use, each with the verified benchmark that justifies the pick. Sources are each model's Hugging Face card or maker announcement.
- Kimi K3 (Moonshot AI). Best overall. 88.3 on Terminal-Bench 2.1, 81.2 on FrontierSWE, 67.5 on DeepSWE, 93.5 on GPQA Diamond, 94.5 on MCPMark-Verified. Mixture-of-Experts, 2.8T total with 104B active (16 of 896 experts routed per token), 1M context, native text and image input. Weights published July 27, 2026 under the custom Kimi K3 License.
- GLM-5.2 (Z.ai). Best MIT-licensed model. 62.1% on SWE-bench Pro, 81.0 on Terminal-Bench 2.1 under Terminus-2, 46.2 on DeepSWE, 99.2 on AIME 2026. 753B parameters, 1M context, standard MIT License. NIST's CAISI assessment called it probably the most capable open-weight model at its release.
- DeepSeek-V4-Pro (DeepSeek-AI). Best MIT generalist for long context. 80.6% on SWE-bench Verified, 67.9 on Terminal-Bench 2.0, 51.8 on Toolathlon. 1.6T total / 49B active, 1M context, MIT. The 284B / 13B DeepSeek-V4-Flash sibling shares the license and the 1M window at a fraction of the serving cost.
- MiniMax M3 (MiniMax AI). Best cheap agentic MoE. 59.0% SWE-bench Pro, 66.0 Terminal-Bench 2.1, 74.2 MCP Atlas, 34.8 SWE-fficiency. 428B total / 23B active, 1M context through MiniMax Sparse Attention, native image and video input. Ships under the MiniMax Community License, which is non-commercial by default.
- Qwen3.6-27B (Alibaba). Best single-GPU model. 77.2% SWE-bench Verified, 53.5% SWE-bench Pro from a dense 27B under Apache-2.0. The 35B-A3B sibling scores 73.4% Verified and 51.5 on Terminal-Bench 2.0 while activating 3B parameters per token.
- Qwen3.5-397B-A17B (Alibaba). Best large Apache-2.0 model. 76.2% SWE-bench Verified, 397B total / 17B active, released February 2026. The permissive-license choice when you want a big MoE without custom terms.
- Gemma 4 (Google DeepMind). Best model family for edge and laptops. Five sizes (E2B, E4B, 12B, 26B-A4B, 31B), Apache-2.0, 128K context on the edge models and 256K on the rest, multimodal with audio on E2B, E4B, and 12B. Google reports the 31B ranking third among open models on the Arena text leaderboard.
- gpt-oss-120b (OpenAI). Best competition coder. 2622 Elo on Codeforces, matching or exceeding o4-mini; 16.2 SWE-bench Pro. 117B total / 5.1B active, 128K context, Apache-2.0.
SWE-bench Verified measures real GitHub-issue resolution in a multi-turn agentic loop, the closest proxy for production coding ability. Codeforces Elo measures competition algorithm coding. HumanEval and MBPP measure isolated function generation. LiveCodeBench is contamination-resistant. A model can lead one benchmark and trail another; rank by the benchmark closest to your workload.
Comparison Table: Size, License, Benchmark
Every model side by side: total parameters, license, context window, the single benchmark it leads on, and the category it wins. Active-parameter counts (the driver of inference cost) are noted where the model is Mixture-of-Experts.
| Model | Size (total / active) | License | Best benchmark | Best for |
|---|---|---|---|---|
| Kimi K3 | 2.8T / 104B | Kimi K3 License | 88.3 Terminal-Bench 2.1 | Best overall |
| GLM-5.2 | 753B | MIT | 62.1% SWE-bench Pro | Best MIT model |
| DeepSeek-V4-Pro | 1.6T / 49B | MIT | 80.6% SWE-bench Verified | MIT generalist, 1M context |
| DeepSeek-V4-Flash | 284B / 13B | MIT | 1M context at 13B active | Cheap long context |
| MiniMax M3 | 428B / 23B | MiniMax Community | 59.0% SWE-bench Pro | Cheap agentic MoE |
| Qwen3.6-27B | 27B (dense) | Apache-2.0 | 77.2% SWE-bench Verified | Single GPU |
| Qwen3.6-35B-A3B | 35B / 3B | Apache-2.0 | 73.4% SWE-bench Verified | Cheapest per token |
| Qwen3.5-397B-A17B | 397B / 17B | Apache-2.0 | 76.2% SWE-bench Verified | Large Apache-2.0 MoE |
| Gemma 4 31B | 30.7B (dense) | Apache-2.0 | 256K context, multimodal | Laptops and edge |
| gpt-oss-120b | 117B / 5.1B | Apache-2.0 | 2622 Codeforces Elo | Competition coding |
Context windows converged at the top. Kimi K3, GLM-5.2, both DeepSeek-V4 variants, and MiniMax M3 all ship 1M-token windows. Gemma 4 spans 128K on E2B and E4B up to 256K on the 12B, 26B-A4B, and 31B sizes. Qwen3.6-27B is 131K, Qwen3.5-397B-A17B is 262K, and gpt-oss-120b remains at 128K. Longer context costs more memory per request, so pick the smallest window that fits your repository.
Best for Coding
For agentic coding, rank by SWE-bench Verified and its harder successors. Verified is close to saturated among frontier open models: DeepSeek-V4-Pro resolves 80.6% and Qwen3.6-27B resolves 77.2%, so the discriminating benchmarks are now SWE-bench Pro, FrontierSWE, and Terminal-Bench 2.1. Kimi K3 leads those at 81.2 FrontierSWE and 88.3 Terminal-Bench 2.1; GLM-5.2 is the best MIT-licensed option at 62.1% SWE-bench Pro.
Kimi K3: 88.3 Terminal-Bench 2.1
81.2 FrontierSWE, 67.5 DeepSWE, 42.0 SWE-Marathon, 77.8 ProgramBench. 2.8T total / 104B active, 1M context, native image input. The strongest open-weight coder, under the custom Kimi K3 License.
GLM-5.2: 62.1% SWE-bench Pro
81.0 Terminal-Bench 2.1 under Terminus-2, 46.2 DeepSWE, 74.4 FrontierSWE dominance. 753B parameters, 1M context, plain MIT License. The best coding-to-license ratio available.
DeepSeek-V4-Pro: 80.6%
80.6% SWE-bench Verified, 67.9 Terminal-Bench 2.0, 73.6 MCPAtlas, 51.8 Toolathlon. 1.6T total / 49B active, 1M context, MIT. The 284B / 13B Flash variant keeps the license and the window for less compute.
The size story flipped this year. Qwen3.6-27B, a dense 27B, resolves 77.2% of SWE-bench Verified and 53.5% of SWE-bench Pro, ahead of every 400B-plus open model from 2025. If your agent loop is latency-bound rather than accuracy-bound, a 27B-class model is now a serious primary, not a fallback.
For the coding-specific deep dive, including how these models pair with a fast-apply edit model, see Best Open Source Coding Model 2026 and Best AI Model for Coding.
Best Small / Local (<=27B)
The leaders above need multiple high-memory GPUs. For a model that runs on a single GPU or a workstation, the pick is Qwen3.6-27B: a dense 27B released April 22, 2026 under Apache-2.0, with a 131K context window, 77.2% on SWE-bench Verified and 53.5% on SWE-bench Pro.
Dense matters here. Qwen3.6-27B activates all 27B parameters per token, which is simpler to serve than a Mixture-of-Experts model and predictable on a single device. If you would rather trade a little accuracy for much lower per-token cost, Qwen3.6-35B-A3B activates 3B parameters and still resolves 73.4% of SWE-bench Verified.
Gemma 4 is the alternative family, and it is the one that scales down furthest: E2B and E4B run on phones, 12B on a laptop, 26B-A4B and 31B on a consumer GPU or workstation. Gemma 4 moved to Apache-2.0, so the license caveat that applied to Gemma 3 is gone. Qwen's own comparison table puts Gemma4-31B at 52.0% SWE-bench Verified, well behind Qwen3.6-27B on coding, so pick Gemma 4 for multimodal and edge deployment rather than for agentic coding.
On Morph's fleet, qwen38-27b and gemma4-31b run alongside the large MoE models, so a router can drop routine turns to a 27B-class model and reserve the frontier models for hard work.
A 27B model still trails the frontier on long-horizon agentic work: Kimi K3 scores 88.3 on Terminal-Bench 2.1 and 42.0 on SWE-Marathon, benchmarks that measure hour-scale sessions rather than single issues. Small models are for local privacy, low cost, latency, and offline use. If you need frontier reliability across dozens of tool calls, you need a large MoE model and the hardware (or a hosted API) to run it.
Best Reasoning
For step-by-step reasoning, Kimi K3 and GLM-5.2 lead the open weights. Kimi K3 scores 93.5 on GPQA Diamond and 91.2 on BrowseComp. GLM-5.2 reaches 99.2 on AIME 2026 and 91.2 on GPQA Diamond, and ships under the standard MIT License, which permits commercial use and distillation for training other models.
The MIT permission on distillation is why so many small reasoning models are trained on outputs from DeepSeek and Z.ai models: the license allows it. If you need an open reasoning model whose outputs you can legally build on, GLM-5.2 or DeepSeek-V4 is the answer. Kimi K3's license is more restrictive, so read it before you train on its outputs.
For competition coding specifically, gpt-oss-120b reaches 2622 Elo on Codeforces, matching or exceeding OpenAI o4-mini, under Apache-2.0. It is smaller (117B total / 5.1B active) and cheaper to serve than R1 while leading on algorithmic contests.
Best for Agentic / Tool Use
Agentic workloads (multi-file edits, run-fix loops, terminal commands, MCP tools) reward models tuned for tool calling and long action sequences. Kimi K3 leads the tool-use benchmarks outright: 94.5 on MCPMark-Verified, 84.8 on OSWorld-Verified, 88.3 on Terminal-Bench 2.1. MiniMax M3 is the value pick at 74.2 MCP Atlas and 66.0 Terminal-Bench 2.1 while activating only 23B of 428B parameters per token.
Kimi K3
94.5 MCPMark-Verified, 84.8 OSWorld-Verified, 88.3 Terminal-Bench 2.1, 42.0 SWE-Marathon. 2.8T / 104B active, 1M context. The frontier for long tool-calling sessions; custom license with obligations for large deployers.
MiniMax M3
74.2 MCP Atlas, 66.0 Terminal-Bench 2.1, 59.0% SWE-bench Pro, 34.8 SWE-fficiency. 428B / 23B active, 1M context via MiniMax Sparse Attention. Cheapest frontier-adjacent agent model, under the non-commercial-by-default MiniMax Community License.
Throughput is the practical bottleneck for agentic loops, where a single task fires dozens of tool calls. A faster open model that resolves the issue in fewer, faster turns often beats a marginally more accurate but slower one. Morph serves the low-active-parameter models (minimax3-428b, dsv4flash, qwen38-27b) precisely for that loop, and offers a separate latency SKU of Kimi K3 (kimik3-fast) for cases where decode speed matters more than price.
Open Weight vs Open Source
Most models called open source are open-WEIGHT. The OSI Open Source AI Definition requires three components: the model parameters, the complete training and inference source code, and training-data information detailed enough to rebuild a substantially equivalent system. Releasing only the weights does not meet that bar.
By the strict OSI definition, almost no leading open model qualifies as open source. The models that do meet the standard (OLMo, Pythia) are not the ones topping benchmark leaderboards. The benchmark leaders on this page are open-weight, not OSI open-source.
For most teams the distinction is academic. Both open-weight and truly open-source models can be self-hosted, inspected, and fine-tuned. The difference is licensing freedom and how much of the training pipeline is disclosed. Teams self-host open-weight LLMs to control cost, keep data private, customize via fine-tuning, and optimize inference for their own workloads instead of sending data to a closed API. See the open source LLM guide for the verified license table, the API rates, and the self-host cost crossover.
Tradeoffs: License and Hardware
Several of the strongest models carry licenses that restrict deployment. State the downside plainly before you build on them.
| Model | License | Commercial use | Note |
|---|---|---|---|
| Qwen3.5, Qwen3.6, gpt-oss-120b | Apache-2.0 | Yes, unrestricted | Most permissive common license |
| Gemma 4 (all sizes) | Apache-2.0 | Yes, unrestricted | Moved off the custom Gemma license |
| GLM-5.2, DeepSeek-V4 Pro/Flash | MIT | Yes, unrestricted | Distillation of outputs permitted |
| Kimi K3 | Kimi K3 License | Yes, with conditions | Extra obligations for large companies and AI service providers |
| MiniMax M3 | MiniMax Community | Conditional | Non-commercial by default; attribution plus notice, written OK above $20M revenue |
| Llama 4 Maverick | Llama 4 Community | Conditional | Not OSI-approved; acceptable-use terms apply |
| Qwen3-Coder-480B-A35B | Apache-2.0 | Yes, unrestricted | Previous generation, same permissive terms |
| DeepSeek-R1, DeepSeek-V3.2, GLM-4.6 | MIT | Yes, unrestricted | Previous generation; R1 explicitly permits distillation |
| Kimi K2 | Modified MIT | Yes, with conditions | Read the modifications before shipping |
| Cohere Command A | CC-BY-NC | No | Non-commercial only |
The MiniMax Community License is the sharpest edge on this list. M3 is free for non-commercial use, but commercial use requires displaying "Built with MiniMax M3" and notifying MiniMax, and above $20M in yearly revenue it requires prior written authorization. Cohere Command A is CC-BY-NC, so it is a research model rather than a production one. Kimi K3 permits commercial deployment but adds obligations aimed at large companies and AI service providers, which is the category most inference platforms fall into.
Hardware is the other tradeoff. Self-hosting Kimi K3 (2.8T total) or DeepSeek-V4-Pro (1.6T) is a real infrastructure project: multiple high-memory GPUs plus a serving stack such as vLLM or SGLang, and a 1M-token window multiplies the KV-cache memory per request. Running the best open model is not free even when the weights are. The cheaper path is a hosted inference API that amortizes the hardware across many users.
How to Run the Best Open Source LLM
Three deployment paths, by model size. Small dense models run locally; large MoE models need a serving stack or a hosted API.
Local (single GPU)
Qwen3.6-27B, Qwen3.6-35B-A3B, and Gemma 4 run on one high-memory GPU via Ollama, vLLM, SGLang, or llama.cpp. Best for privacy, offline use, and low volume. Gemma 4 E2B and E4B go down to phones.
Self-hosted cluster
The frontier MoE models (Kimi K3 2.8T, DeepSeek-V4-Pro 1.6T, GLM-5.2 753B, MiniMax M3 428B) need multiple GPUs and vLLM or SGLang. Full control, but a real infrastructure and on-call cost.
Hosted API
Skip the hardware entirely. A router picks the best open model per task and serves it behind one OpenAI-compatible endpoint. Morph serves kimik3, glm52-744b, minimax3-428b, dsv4flash, gemma4-31b, and qwen38-27b.
A router is the efficient default when you want the best open model per task without owning the GPUs. It classifies each prompt and sends easy turns to a cheap small model and hard turns to a large one, which is how a 27B-class model and a 200B+ model coexist behind a single API. Morph's router classifies prompt difficulty in ~430ms into four tiers for 40-70% API cost savings. See What Is an LLM Router.
Call open models through one OpenAI-compatible API
import OpenAI from "openai"
// Morph's API is OpenAI-compatible; point the SDK at it.
const client = new OpenAI({
apiKey: process.env.MORPH_API_KEY,
baseURL: "https://api.morphllm.com/v1",
})
// Served open-weight models on the fleet:
// morph-kimik3, morph-glm52-744b, morph-minimax3-428b,
// morph-dsv4flash, morph-gemma4-31b, morph-qwen38-27b
const res = await client.chat.completions.create({
model: "morph-glm52-744b",
messages: [{ role: "user", content: "Refactor this module to use dependency injection." }],
})
console.log(res.choices[0].message.content)Previous Generation: Qwen3-Coder, DeepSeek-R1, Kimi K2, GLM-4.6
Most open-weight capacity in production today is one generation behind the list above. Weights do not expire, clusters are provisioned for a specific model, and a migration costs an evaluation cycle. These are the models that still hold that installed base, with the size, license, and context window each of them actually ships.
| Model | Size (total / active) | License | Context | Replaced by |
|---|---|---|---|---|
| Qwen3-Coder-480B-A35B | 480B / 35B | Apache-2.0 | 256K native | Qwen3.5-397B-A17B, Qwen3.6-27B |
| DeepSeek-R1 | 671B / 37B | MIT | 128K | DeepSeek-V4-Pro |
| DeepSeek-V3.2 | 671B / 37B | MIT | 128K | DeepSeek-V4-Pro / V4-Flash |
| Kimi K2 | 1T / 32B | Modified MIT | 128K | Kimi K3 |
| GLM-4.6 | 355B / 32B | MIT | 200K | GLM-5.2 |
| Gemma 3 27B | 27B (dense) | Gemma license | 128K | Gemma 4 (Apache-2.0) |
| Llama 4 Maverick | 400B / 17B | Llama 4 Community | 1M | no open successor yet |
Qwen3-Coder-480B-A35B is the one worth keeping deliberately. Alibaba shipped it as a 480B Mixture-of-Experts with 35B active parameters and a 256K native window that extrapolates to 1M, under Apache-2.0. Independent SWE-bench Verified runs score it at 66.5% and SWE-bench Pro at 38.7%, roughly 14 points of Verified behind DeepSeek-V4-Pro, on a license with no conditions attached and a serving footprint a third the size of the current frontier.
DeepSeek-R1 is the reasoning model the rest of the field was distilled from. 671B total, 37B active, 128K context, MIT, and the license text states outright that derivative works and distillation for training other LLMs are permitted. DeepSeek-V3.2 shares the architecture. Both are still the cheapest way to get a large MIT-licensed reasoner onto your own hardware.
Kimi K2 is 1T total with 32B active over 384 experts, 128K context, Modified MIT. Moonshot reported 65.8 on SWE-bench Verified and 66.1 on Tau2-Bench without extended thinking. GLM-4.6 is 355B-A32B under plain MIT and was the release where Z.ai took the context window from 128K to 200K. MiniMax-M2 preceded M3 with 230B total and 10B active under a Modified MIT license, the lowest active-parameter count of that generation.
When to migrate: agentic work over hour-scale sessions, where Terminal-Bench 2.1 and SWE-Marathon separate Kimi K3 from everything above by more than 20 points. When to stay: single-issue coding, fill-in-the-middle completion, and reasoning at fixed cost per token. Morph runs both generations on the same fleet, so a router can send a routine turn to a previous-generation model and a hard turn to the frontier without changing the endpoint.
Frequently Asked Questions
What is the best open source LLM right now?
As of August 2026, Kimi K3: 88.3 on Terminal-Bench 2.1, 81.2 on FrontierSWE, 2.8T total parameters with 104B active, 1M context, weights published July 27, 2026. GLM-5.2 is the best model under a plain MIT license (62.1% SWE-bench Pro, 81.0 Terminal-Bench 2.1), DeepSeek-V4-Pro resolves 80.6% of SWE-bench Verified under MIT, and Qwen3.6-27B reaches 77.2% from a dense 27B under Apache-2.0.
What is the best open source LLM for coding?
Kimi K3 leads at 88.3 Terminal-Bench 2.1 and 81.2 FrontierSWE. GLM-5.2 is the strongest MIT-licensed coder at 62.1% on SWE-bench Pro, and DeepSeek-V4-Pro reaches 80.6% on SWE-bench Verified with a 1M context window. For a model that fits on one GPU, Qwen3.6-27B scores 77.2% SWE-bench Verified and 53.5% SWE-bench Pro under Apache-2.0.
What is the best small or local open source LLM?
Qwen3.6-27B: dense 27B, Apache-2.0, 131K context, 77.2% SWE-bench Verified and 53.5% SWE-bench Pro. Gemma 4 is the alternative and now ships under Apache-2.0 as well, in five sizes from E2B to 31B with 128K to 256K context, which covers phones and laptops as well as workstations.
Are open source LLMs as good as GPT-5 or Claude?
On coding benchmarks the gap has closed. NIST's CAISI evaluation of GLM-5.2 found it was probably the most capable open-weight model at its release and similar to GPT-5.2 overall. Kimi K3 scores 93.5 on GPQA Diamond and 88.3 on Terminal-Bench 2.1. Closed frontier models still lead on the hardest reasoning sets, but the margin is small and open weights win on cost and control.
Which open source LLM license is best for commercial use?
MIT and Apache-2.0. GLM-5.2 and both DeepSeek-V4 variants are MIT. Qwen3.5, Qwen3.6, Gemma 4, and gpt-oss-120b are Apache-2.0. Read the terms first on Kimi K3 (custom license with extra obligations for large companies and AI service providers), MiniMax M3 (non-commercial by default), Llama 4, and Cohere Command A (CC-BY-NC forbids commercial use).
How do I run the best open source LLM?
Models at or below 31B (Qwen3.8-27B, Gemma 4) run on a single high-memory GPU via vLLM, SGLang, Ollama, or llama.cpp. The frontier MoE models (Kimi K3 2.8T, DeepSeek-V4-Pro 1.6T, GLM-5.2 753B, MiniMax M3 428B) need a multi-GPU cluster. To skip the hardware, use a hosted inference API: Morph serves kimik3, glm52-744b, minimax3-428b, dsv4flash, gemma4-31b, and qwen38-27b through one OpenAI-compatible endpoint.
Is Qwen3-Coder, DeepSeek-R1, or Kimi K2 still worth running?
Yes, and most self-hosted open-weight capacity still runs on them. Qwen3-Coder-480B-A35B is 480B total with 35B active, 256K native context, Apache-2.0, scored at 66.5% SWE-bench Verified and 38.7% SWE-bench Pro in independent runs. DeepSeek-R1 is 671B / 37B active at 128K under MIT, which explicitly permits distillation for training other models. Kimi K2 is 1T / 32B active at 128K under a Modified MIT license, reported at 65.8 SWE-bench Verified without extended thinking. GLM-4.6 is 355B-A32B at 200K under plain MIT. All four sit a generation behind Kimi K3, GLM-5.2, and DeepSeek-V4 on agentic benchmarks, and all four cost less to serve.
Why are most open source LLMs actually open weight?
The OSI Open Source AI Definition requires the weights, the full training and inference code, and detailed training-data information. Almost no benchmark-topping model releases all three; they release weights only, making them open-weight. The practical difference is licensing freedom: open-weight models under Apache-2.0 or MIT can still be self-hosted, inspected, fine-tuned, and used commercially.
Related Resources
The fastest endpoints are private deployments
Morph's top speeds come from dedicated deployments, not shared public endpoints: speculators trained on your traffic, caching tuned to your workload, and volume discounts over public per-token rates. Over 100 billion tokens per day run this way.
Run the Best Open Model Per Task, Without the GPUs
Morph's router classifies each prompt in ~430ms and serves the best open model for it (kimik3, glm52-744b, minimax3-428b, dsv4flash, qwen38-27b) through one OpenAI-compatible API. 40-70% cost savings. No cluster to run.
