Artificial intelligence
Kimi K2 and K3: open-weight models from Moonshot AI.
What Mixture-of-Experts means in practice, what changed from K2 (1T) to K3 (2.8T, 1M context, always-on reasoning), how to use them by app, API or weights, what they cost, how to read the benchmarks and what the license says.
O que é o KimiWhat Kimi is
Kimi é a família de modelos de linguagem da Moonshot AI, empresa de Pequim. O nome serve para duas coisas: o assistente (site e app em kimi.com) e os modelos por trás dele, vendidos por API e, na maioria das versões, publicados como pesos abertos (open weights) no Hugging Face. É por esse segundo motivo que o Kimi aparece junto de DeepSeek e Qwen quando se fala em modelos “abertos” que competem com os fechados.Kimi is the language-model family from Moonshot AI, a company based in Beijing. The name covers two things: the assistant (website and app at kimi.com) and the models behind it, sold through an API and, for most versions, published as open weights on Hugging Face. That second point is why Kimi shows up next to DeepSeek and Qwen when people talk about “open” models that compete with closed ones.
Esta nota cobre o Kimi K2 (julho de 2025) e o Kimi K3 (lançado em julho de 2026), e o que mudou entre eles. Para a ideia geral de modelos abertos e como rodá-los, veja LLMs de código aberto e agentes; para a arquitetura base de todos eles, Attention Is All You Need.This note covers Kimi K2 (July 2025) and Kimi K3 (released July 2026), and what changed between them. For the general idea of open models and how to run them, see Open-source LLMs and AI agents; for the architecture all of them build on, Attention Is All You Need.
A linha do tempo e a famíliaThe timeline and the family
| ModeloModel | O que éWhat it is |
|---|---|
| Kimi K2 | Lançado em julho de 2025. MoE com 1 trilhão de parâmetros (32 bilhões ativos por token), contexto de 128K tokens, pesos abertos em duas formas: Kimi-K2-Base (modelo de base, para quem quer ajustar) e Kimi-K2-Instruct (já treinado para seguir instruções e usar ferramentas).Released July 2025. MoE with 1 trillion parameters (32 billion active per token), 128K-token context, open weights in two forms: Kimi-K2-Base (base model, for fine-tuning) and Kimi-K2-Instruct (already trained to follow instructions and use tools). |
| Kimi K2.5 | Sucessor do K2, de janeiro de 2026 (data citada pela imprensa; esta nota não detalha o modelo).K2’s successor, from January 2026 (date cited by the press; this note does not detail the model). |
| Kimi K2.6 · K2.7 Code | Hoje formam a linha de custo menor da API: K2.6 de uso geral e K2.7 Code para programação, ambos a US$ 0,95 por milhão de tokens de entrada e US$ 4 de saída, com contexto de pelo menos 256 mil tokens (valores da cobertura do lançamento do K3).Today they form the lower-cost line of the API: K2.6 for general use and K2.7 Code for programming, both at $0.95 per million input tokens and $4 output, with a context of at least 256 thousand tokens (figures from the K3 launch coverage). |
| Kimi K3 | O carro-chefe. API e app em 16 de julho de 2026; pesos publicados em 27 de julho (alguns relatos dizem que foram um dia antes). MoE de 2,8 trilhões de parâmetros, 104 bilhões ativos, contexto de 1 milhão de tokens, entende imagens e sempre raciocina antes de responder.The flagship. API and app on July 16, 2026; weights published on July 27 (some reports say a day earlier). MoE with 2.8 trillion parameters, 104 billion active, 1-million-token context, understands images and always reasons before answering. |
Mixture-of-Experts: por que 2,8 trilhões “custam” 104 bilhõesMixture-of-Experts: why 2.8 trillion “costs” 104 billion
Num modelo denso, cada token passa por todos os parâmetros. Num Mixture-of-Experts (MoE), a parte “feed-forward” de cada camada é dividida em centenas de blocos pequenos, os especialistas. Um pequeno roteador (router) olha o token e escolhe só alguns especialistas para ele; os outros ficam parados. O modelo tem muito conhecimento guardado (muitos parâmetros), mas cada token só “paga” o cálculo dos poucos especialistas escolhidos mais as partes que sempre rodam (como a atenção).In a dense model, every token goes through all the parameters. In a Mixture-of-Experts (MoE), each layer’s “feed-forward” part is split into hundreds of small blocks, the experts. A small router looks at the token and picks only a few experts for it; the others sit idle. The model stores a lot of knowledge (many parameters), but each token only “pays” the compute of the few chosen experts plus the parts that always run (like attention).
As contas, com os números das fichas técnicasThe arithmetic, with the numbers from the model cards
| K2 | K3 | |
|---|---|---|
| Parâmetros totaisTotal parameters | 1T | 2.8T |
| Parâmetros ativos por tokenActive parameters per token | 32B | 104B |
| Fração ativa (conta minha)Active fraction (my arithmetic) | ≈ 3,2% | ≈ 3,7% |
| Especialistas (escolhidos por token / compartilhados)Experts (picked per token / shared) | 384 (8 / 1) | 896 (16 / 2) |
| CamadasLayers | 61 (1 densa)61 (1 dense) | 93 (1 densa)93 (1 dense) |
| ContextoContext | 128K | 1M (1.048.576)1M (1,048,576) |
| Vocabulário | 160K | 160K |
- Custo de cálculo segue os ativos: o K3 gasta por token algo da ordem de um modelo denso de ~100B, não de 2,8T. É por isso que a resposta sai em velocidade aceitável e o preço da API é viável.Compute cost follows the active parameters: per token, K3 spends something on the order of a ~100B dense model, not a 2.8T one. That is why answers come out at acceptable speed and the API price is viable.
- Custo de memória segue os totais: para hospedar, você precisa carregar tudo. Estimativa minha, só dos pesos: o K3 foi treinado já considerando pesos em 4 bits (MXFP4), ou seja ~0,5 byte por parâmetro, o que dá algo como 1,4 TB; o K2 vinha em 8 bits (block-fp8), ~1 TB. Isso sem contar cache de atenção e ativações. Nenhuma das fichas dá um requisito oficial de hardware, e em ambos os casos o resultado é um servidor com vários GPUs (e não um computador comum).Memory cost follows the total: to host it, you must load everything. My estimate, weights only: K3 was trained with 4-bit weights in mind (MXFP4), about 0.5 byte per parameter, which gives something like 1.4 TB; K2 shipped in 8 bits (block-fp8), ~1 TB. That is before attention cache and activations. Neither card gives an official hardware requirement, and in both cases the result is a multi-GPU server (not an ordinary computer).
- Por que não dá para rodar em casa. Versões quantizadas feitas pela comunidade (GGUF para llama.cpp, Ollama, LM Studio) existem e reduzem o tamanho, mas continuam em centenas de GB. Para estudar o K3 sem infraestrutura, a rota realista é a API.Why you cannot run it at home. Community quantizations (GGUF for llama.cpp, Ollama, LM Studio) exist and shrink the size, but still run to hundreds of GB. To study K3 without infrastructure, the realistic route is the API.
O que mudou do K2 para o K3What changed from K2 to K3
| K2 (Instruct) | K3 | |
|---|---|---|
| AtençãoAttention | MLA em todas as camadasMLA in every layer | híbrida: 69 camadas de Kimi Delta Attention (linear) + 24 de MLA com gatehybrid: 69 Kimi Delta Attention (linear) layers + 24 gated MLA layers |
| EntradaInput | textotext | texto e imagem (nativo, com o codificador MoonViT-V2 de 401M de parâmetros)text and image (native, with the 401M-parameter MoonViT-V2 encoder) |
| RaciocínioReasoning | responde direto (versão “Instruct”)answers directly (the “Instruct” version) | sempre ligado; nível pelo campo reasoning_effort: low, high ou max (padrão)always on; level set by the reasoning_effort field: low, high or max (default) |
| PrecisãoPrecision | pesos em block-fp8block-fp8 weights | treino consciente de quantização: pesos MXFP4 e ativações MXFP8quantization-aware training: MXFP4 weights and MXFP8 activations |
| LicençaLicense | MIT modificadaModified MIT | “Kimi K3 License” (própria)“Kimi K3 License” (custom) |
| Motores de inferência indicadosRecommended inference engines | vLLM, SGLang, KTransformers, TensorRT-LLM | vLLM, SGLang, TokenSpeed |
A atenção híbrida, em uma figuraHybrid attention, in one figure
A atenção “completa” compara cada token com todos os anteriores, e guarda um cache KV que cresce a cada token. Com 1 milhão de tokens, esse custo (de tempo e de memória) vira o gargalo. A atenção linear troca isso por um estado de tamanho fixo que vai sendo atualizado: custo por token constante, mas com menos “memória exata” do passado. O K3 usa as duas: a linear (KDA, a variante própria da Moonshot) na maioria das camadas e a completa-comprimida (MLA) em uma camada a cada ~4, para não perder detalhe preciso. Os números (69 e 24 camadas) vêm da ficha do modelo; a explicação do porquê é a motivação geral da arquitetura híbrida, não um trecho citado do relatório técnico.“Full” attention compares each token with all previous ones, and keeps a KV cache that grows with every token. At 1 million tokens, that cost (in time and memory) becomes the bottleneck. Linear attention swaps it for a fixed-size state that is updated as you go: constant cost per token, but with less “exact memory” of the past. K3 uses both: linear (KDA, Moonshot’s own variant) in most layers and compressed full attention (MLA) in about one layer out of four, so precise detail is not lost. The numbers (69 and 24 layers) come from the model card; the reason why is the general motivation for hybrid architectures, not a quoted passage of the technical report.
Como usar: app, API e pesosHow to use: app, API and weights
| CaminhoRoute | Para quemFor whom | ComoHow |
|---|---|---|
| App / siteApp / website | testar, conversar, tarefas pontuaistrying it out, chatting, one-off tasks | kimi.com (a cobertura do lançamento diz que dá para usar de graça, entrando com Google ou telefone, sem cartão; confira os limites atuais)kimi.com (launch coverage says it is free to use, signing in with Google or a phone number, no card; check current limits) |
| API | colocar em um produto ou agenteputting it in a product or agent | platform.kimi.ai, com endpoints compatíveis com OpenAI e com Anthropic; modelo kimi-k3. Também aparece em agregadores como o OpenRouter.platform.kimi.ai, with OpenAI- and Anthropic-compatible endpoints; model kimi-k3. It also appears on aggregators such as OpenRouter. |
| Pesos abertosOpen weights | empresa com GPUs, exigência de dados dentro de casa, ajuste finoa company with GPUs, data-stays-in-house requirements, fine-tuning | Hugging Face: moonshotai/Kimi-K3 (e moonshotai/Kimi-K2-Instruct), servindo com vLLM, SGLang ou TokenSpeedHugging Face: moonshotai/Kimi-K3 (and moonshotai/Kimi-K2-Instruct), served with vLLM, SGLang or TokenSpeed |
| Programação no terminalCoding in the terminal | usar como agente de códigousing it as a coding agent | Kimi Code (CLI da Moonshot, com integração a VS Code, Cursor e Zed, segundo a cobertura do lançamento). Também dá para apontar outros agentes para o endpoint compatível.Kimi Code (Moonshot’s CLI, with VS Code, Cursor and Zed integration, per the launch coverage). Other agents can also be pointed at the compatible endpoint. |
Chamando a APICalling the API
Como o endpoint é compatível com o SDK da OpenAI, o código é o de sempre; só mudam a URL base, a chave e o nome do modelo. Pegue a URL base e a chave no painel da plataforma (não escrevi a URL aqui porque a ficha do modelo não a traz).Because the endpoint is compatible with the OpenAI SDK, the code is the usual one; only the base URL, the key and the model name change. Get the base URL and key from the platform dashboard (I did not write the URL here because the model card does not give it).
from openai import OpenAI
client = OpenAI(
base_url="<URL base da documentação em platform.kimi.ai>",
api_key=os.environ["KIMI_API_KEY"], # nunca no código-fonte
)
resp = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Explique um índice B-tree em 3 frases."}],
extra_body={"reasoning_effort": "low"}, # low | high | max (padrão: max)
)
msg = resp.choices[0].message
print(msg.content) # a resposta
print(getattr(msg, "reasoning_content", None)) # o raciocínio (sempre vem)
- O raciocínio custa tokens. Como o modo de pensar está sempre ligado e o padrão é
max, uma pergunta simples pode gastar muito mais tokens de saída do que a resposta visível. Uselowpara tarefas fáceis e meça.Reasoning costs tokens. Since thinking mode is always on and the default ismax, a simple question can spend far more output tokens than the visible answer. Uselowfor easy tasks and measure. - Ferramentas e histórico. A ficha diz que, em conversas de várias voltas e chamadas de ferramenta, você deve devolver a mensagem completa do assistente, incluindo
reasoning_contentetool_calls, e não só ocontent. Se o seu código só guarda o texto, o modelo perde o fio do próprio raciocínio. É o mesmo princípio do harness de agente: quem monta o histórico decide o que o modelo “lembra”.Tools and history. The card says that, in multi-turn conversations and tool calls, you must send back the full assistant message, includingreasoning_contentandtool_calls, not justcontent. If your code only keeps the text, the model loses the thread of its own reasoning. It is the same principle as the agent harness: whoever builds the history decides what the model “remembers”. - Cache automático. A Moonshot diz que o cache de contexto é automático, sem ID, TTL ou parâmetro extra. Na prática: mantenha o começo do prompt (instruções, documentos) igual entre chamadas, porque só o trecho repetido do início é cobrado com desconto.Automatic caching. Moonshot says context caching is automatic, with no ID, TTL or extra parameter. In practice: keep the start of the prompt (instructions, documents) identical between calls, because only the repeated prefix is billed at a discount.
Servindo os pesos (K2 como exemplo)Serving the weights (K2 as an example)
A ficha do K2 recomenda vLLM, SGLang, KTransformers ou TensorRT-LLM e traz comandos prontos. A forma geral é esta (confira as flags no guia de deploy do modelo, que mudam com a versão do motor):K2’s card recommends vLLM, SGLang, KTransformers or TensorRT-LLM and ships ready-made commands. The general shape is this (check the flags in the model’s deploy guide, which change with the engine version):
# forma geral; o número de GPUs e as flags dependem do modelo e da versão
vllm serve moonshotai/Kimi-K2-Instruct \
--tensor-parallel-size 16 \
--trust-remote-code
Depois disso você tem um servidor com a mesma API compatível com OpenAI, na sua rede, e o código acima funciona trocando a URL base. Nenhum token sai da sua infraestrutura. Não executei esse comando (não tenho o hardware); ele ilustra o formato.After that you have a server with the same OpenAI-compatible API, on your network, and the code above works by swapping the base URL. No token leaves your infrastructure. I did not run this command (I do not have the hardware); it illustrates the format.
Quanto custaWhat it costs
| Modelo (por milhão de tokens)Model (per million tokens) | EntradaInput | Entrada em cacheCached input | SaídaOutput |
|---|---|---|---|
| K3 | US$ 3 | US$ 0,30 | US$ 15 |
| K2.6 · K2.7 Code | US$ 0,95 | — | US$ 4 |
Um exemplo para ter noção: uma tarefa de agente que manda 100 mil tokens de contexto (90 mil deles repetidos de uma chamada anterior, portanto em cache) e recebe 5 mil tokens de saída (raciocínio incluído).An example to get a feel: an agent task that sends 100 thousand tokens of context (90 thousand of them repeated from an earlier call, hence cached) and gets 5 thousand output tokens (reasoning included).
entrada nova 10.000 tokens x US$ 3 / 1.000.000 = US$ 0,030
entrada em cache 90.000 tokens x US$ 0,30 / 1.000.000 = US$ 0,027
saída 5.000 tokens x US$ 15 / 1.000.000 = US$ 0,075
total = US$ 0,132 por chamada
Sem o cache, a entrada custaria 100.000 x US$ 3 / 1.000.000 = US$ 0,30 e o total subiria para US$ 0,375. O cache corta a conta pela metade, e ainda assim a saída (US$ 0,075) é o maior item: reduzir o esforço de raciocínio costuma economizar mais do que qualquer outra coisa. Preços vêm da cobertura do lançamento e mudam; confira em platform.kimi.ai.Without the cache, the input would cost 100,000 x $3 / 1,000,000 = $0.30 and the total would rise to $0.375. Caching cuts the bill by more than half, and still the output ($0.075) is the biggest item: lowering reasoning effort usually saves more than anything else. Prices come from the launch coverage and change; check platform.kimi.ai.
Benchmarks: como ler os númerosBenchmarks: how to read the numbers
Os números abaixo são do lançamento do K3 e do K2. A maior parte é divulgada pela própria Moonshot; a cobertura da imprensa diz que a verificação independente ainda estava em andamento. Use como ordem de grandeza, não como veredito.The numbers below are from the K3 and K2 launches. Most are published by Moonshot itself; press coverage says independent verification was still under way. Use them as orders of magnitude, not as a verdict.
| Benchmark | ResultadoResult | O que medeWhat it measures |
|---|---|---|
| BrowseComp (K3) | 91.2 / 100 | pesquisar e juntar informação difícil de achar navegando na websearching and piecing together hard-to-find information by browsing the web |
| GDPval-AA v2 (K3) | 1.687, 3º lugar1,687, 3rd place | tarefas de trabalho de escritório/profissional, pontuação Elo; à frente do Claude Opus 4.8 (1.600), atrás do Fable 5 Max (1.815) e do GPT-5.6 Sol Max (1.747,8), segundo a coberturaprofessional / office-work tasks, Elo-style score; ahead of Claude Opus 4.8 (1,600), behind Fable 5 Max (1,815) and GPT-5.6 Sol Max (1,747.8), per the coverage |
| Frontend Code Arena (K3) | 1.679, 1º lugar1,679, 1st place | geração de interfaces web, avaliada por votação humanaweb interface generation, judged by human votes |
| SWE-bench Verified (K2) | 65.8 (71.6 com várias tentativaswith multiple attempts) | corrigir issues reais de repositórios Python; marca de julho de 2025fixing real Python repository issues; a July 2025 mark |
| MATH-500 (K2) | 97.4 | problemas de matemática de ensino médio/olimpíada levehigh-school / light-olympiad math problems |
- Quem mede importa. Resultado da própria empresa tende a ser o melhor cenário (configuração escolhida, esforço máximo de raciocínio). Um ranking independente (Artificial Analysis) colocou o K3 em 3º no geral no lançamento, consistente com “muito bom, mas não o primeiro”.Who measures matters. A company’s own result tends to be the best case (chosen setup, maximum reasoning effort). An independent ranking (Artificial Analysis) placed K3 3rd overall at launch, consistent with “very good, but not first”.
- Benchmarks envelhecem. O número do K2 é de 2025 e só serve para comparar com a época. Os modelos novos já passaram dele; compare modelos pelos testes mais recentes e, melhor ainda, pela sua tarefa, com 20 ou 30 exemplos reais.Benchmarks age. The K2 figure is from 2025 and only serves to compare with that time. Newer models have passed it; compare models on the latest tests and, better still, on your task, with 20 or 30 real examples.
- “Chip em 48 horas”, “astrofísica em 2 horas”. A Moonshot divulgou demonstrações longas de agente (um projeto de chip de teste com ferramentas de código aberto; a reprodução de um resultado de astrofísica). São casos escolhidos pela empresa, descritos pela própria; mostram o tipo de trabalho de longa duração que o modelo mira, não um desempenho que você terá em qualquer tarefa.“Chip in 48 hours”, “astrophysics in 2 hours”. Moonshot published long agent demos (a test chip design with open-source tools; the reproduction of an astrophysics result). They are company-chosen cases, described by the company; they show the kind of long-running work the model aims at, not performance you will get on any task.
Licença e cuidadosLicense and cautions
- K2: MIT modificada. A MIT é a licença mais permissiva que existe; a versão “modificada” acrescenta uma exigência de atribuição para produtos muito grandes. Os limites exatos estão no arquivo
LICENSEdo repositório: leia-o em vez de confiar em resumos.K2: modified MIT. MIT is about the most permissive license there is; the “modified” version adds an attribution requirement for very large products. The exact thresholds are in the repository’sLICENSEfile: read it instead of trusting summaries. - K3: licença própria. Os pesos e o código saíram sob a “Kimi K3 License”, que não é MIT nem está na lista de licenças aprovadas pela OSI. Segundo o OpenRouter, ela exige exibir “Kimi K3” na interface de produtos com mais de 100 milhões de usuários ativos por mês ou mais de US$ 20 milhões de receita mensal. Fontes divergem nos limites e há relato de uma regra separada para empresas que vendem inferência hospedada; trate os números como não confirmados até ler o texto da licença.K3: custom license. The weights and code were released under the “Kimi K3 License”, which is not MIT and not on the OSI-approved list. According to OpenRouter, it requires displaying “Kimi K3” in the interface of products with over 100 million monthly active users or over $20 million in monthly revenue. Sources differ on the thresholds and there is a report of a separate rule for companies selling hosted inference; treat the numbers as unconfirmed until you read the license text.
- Para quase todo mundo, um projeto pequeno ou médio fica muito abaixo desses limites. A diferença prática de “aberto” aparece mais na liberdade de hospedar você mesmo, ajustar o modelo e manter os dados em casa.For almost everyone, a small or mid-size project stays far below those thresholds. The practical difference of “open” shows mostly in the freedom to host it yourself, fine-tune the model and keep data in-house.
- Dados na API oficial. Usar a API da Moonshot significa enviar seus prompts a um serviço de uma empresa chinesa. Leia os termos de uso e de privacidade antes de mandar dados de clientes, código proprietário ou qualquer coisa sensível; se isso for um problema, hospede os pesos ou use um provedor de sua confiança. É a mesma análise que vale para qualquer API de modelo, com as exigências legais do seu setor e país.Data on the official API. Using Moonshot’s API means sending your prompts to a service run by a Chinese company. Read the terms of use and privacy policy before sending customer data, proprietary code or anything sensitive; if that is a problem, host the weights or use a provider you trust. It is the same analysis that applies to any model API, with the legal requirements of your sector and country.
- Segurança de agentes. Um modelo forte em tarefas longas com ferramentas pode fazer estragos reais se tiver acesso demais. Aplique os cuidados de harness e guardrails: permissões mínimas, ambiente isolado, confirmação humana para ações irreversíveis.Agent safety. A model that is strong at long tool-using tasks can do real damage if it has too much access. Apply the harness and guardrails care: least privilege, an isolated environment, human confirmation for irreversible actions.
Quando escolher o KimiWhen to choose Kimi
| SituaçãoSituation | Faz sentido?Makes sense? |
|---|---|
| Agente que trabalha por horas com muitas ferramentas e contexto enormeAn agent that works for hours with many tools and a huge context | Sim: é o alvo declarado do K3 (1M de contexto, atenção híbrida, raciocínio longo). Teste com a sua carga.Yes: it is K3’s stated target (1M context, hybrid attention, long reasoning). Test with your own load. |
| Exigência de que os dados não saiam da empresaA requirement that data not leave the company | Sim, se você tem GPUs para hospedar o K3 ou o K2 (infraestrutura pesada). Senão, o ganho de “aberto” não se realiza.Yes, if you have GPUs to host K3 or K2 (heavy infrastructure). Otherwise the “open” gain is not realised. |
| Muito volume de chamadas simples e baratasLots of simple, cheap calls | Provavelmente a linha K2.6 (US$ 0,95 / 4) ou um modelo menor; o raciocínio sempre ligado do K3 pesa na conta.Probably the K2.6 line ($0.95 / 4) or a smaller model; K3’s always-on reasoning weighs on the bill. |
| Aprender como funciona um modelo de fronteira por dentroLearning how a frontier model works inside | Sim: as fichas técnicas e o relatório são públicos (MoE, atenção híbrida, QAT). Comece pelo K2, mais simples, e depois leia o que mudou no K3.Yes: the model cards and report are public (MoE, hybrid attention, QAT). Start with K2, which is simpler, and then read what changed in K3. |
| Dados sensíveis e nenhuma infraestrutura própriaSensitive data and no infrastructure of your own | Cuidado: a API oficial envia os dados à Moonshot. Avalie termos e alternativas antes.Careful: the official API sends data to Moonshot. Evaluate the terms and alternatives first. |
- Hugging Face · moonshotai/Kimi-K3 (arquitetura, licença, thinking, API)
- Hugging Face · moonshotai/Kimi-K2-Instruct (arquitetura, licença MIT modificada, deploy)
- VentureBeat · Moonshot AI releases Kimi K3 (datas, preços, benchmarks divulgados)
- OpenRouter · Is Kimi K3 open source? (licença e limites, citados em resumo de busca)
- HPCwire · China’s Moonshot AI releases trillion-parameter model Kimi K2
- Fortune · Moonshot’s Kimi K3 pushes Chinese AI into Fable-level territory