# Kimi K2.5

Kimi K2.5, lanzado el 27 de enero de 2026 por Moonshot AI, es un **modelo multimodal Mixture-of-Experts de 1 billón de parámetros** con 32B de parámetros activos por token. Construido mediante preentrenamiento continuo en \~15 billones de tokens mixtos visuales y de texto sobre la base Kimi-K2-Base, entiende de forma nativa texto, imágenes y vídeo. K2.5 introduce **Agent Swarm** tecnología — coordinando hasta 100 agentes de IA especializados simultáneamente — y alcanza rendimiento de vanguardia en programación (76.8% SWE-bench Verified), visión y tareas agentivas. Disponible bajo una **licencia de pesos abiertos** en HuggingFace.

## Características clave

* **1T total / 32B activos** — arquitectura MoE de 384 expertos con atención MLA y SwiGLU
* **Multimodal nativo** — preentrenado en tokens visión–lenguaje; entiende imágenes, vídeo y texto
* **Agent Swarm** — descompone tareas complejas en sub-tareas paralelas mediante agentes generados dinámicamente
* **Ventana de contexto de 256K** — procesa bases de código completas, documentos largos y transcripciones de vídeo
* **Razonamiento híbrido** — soporta tanto modo instantáneo (rápido) como modo de pensamiento (razonamiento profundo)
* **Fuerte en programación** — 76.8% SWE-bench Verified, 73.0% SWE-bench Multilingual

## Requisitos

Kimi K2.5 es un modelo masivo — el checkpoint FP8 es \~630GB. Alojarlo uno mismo requiere hardware serio.

| Componente | Cuantizado (GGUF Q2)    | FP8 Completo  |
| ---------- | ----------------------- | ------------- |
| GPU        | 1× RTX 4090 + 256GB RAM | 8× H200 141GB |
| VRAM       | 24GB + descarga a CPU   | 1.128GB       |
| RAM        | 256GB+                  | 256GB         |
| Disco      | 400GB SSD               | 700GB NVMe    |
| CUDA       | 12.0+                   | 12.0+         |

**recomendación de Clore.ai**: Para serving en precisión completa, alquila 8× H200 (\~$24–48/día). Para inferencia local cuantizada, una sola H100 80GB o incluso una RTX 4090 + fuerte descarga a CPU funciona a velocidad reducida.

## Inicio rápido con llama.cpp (Cuantizado)

La forma más accesible de ejecutar K2.5 localmente — usando las cuantizaciones GGUF de Unsloth:

```bash
# Clonar y compilar llama.cpp
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build -DGGML_CUDA=ON && cmake --build build --config Release -j

# Descargar modelo cuantizado (Q2_K_XL — 375GB, buen equilibrio calidad/tamaño)
huggingface-cli download unsloth/Kimi-K2.5-GGUF \
  Kimi-K2.5-UD-Q2_K_XL-00001-of-00005.gguf \
  Kimi-K2.5-UD-Q2_K_XL-00002-of-00005.gguf \
  Kimi-K2.5-UD-Q2_K_XL-00003-of-00005.gguf \
  Kimi-K2.5-UD-Q2_K_XL-00004-of-00005.gguf \
  Kimi-K2.5-UD-Q2_K_XL-00005-of-00005.gguf \
  --local-dir ./models

# Ejecutar inferencia (ajusta --n-gpu-layers según tu VRAM)
./build/bin/llama-server \
  -m ./models/Kimi-K2.5-UD-Q2_K_XL-00001-of-00005.gguf \
  --n-gpu-layers 10 \
  --threads 32 \
  --ctx-size 16384 \
  --host 0.0.0.0 --port 8080
```

> **Nota**: La visión aún no es compatible en GGUF/llama.cpp para K2.5. Para funciones multimodales, usa vLLM.

## Configuración vLLM (Producción — Modelo completo)

Para serving en producción con soporte multimodal completo:

```bash
# Instalar vLLM nightly (K2.5 requiere la última versión)
pip install -U vllm --pre \
  --extra-index-url https://wheels.vllm.ai/nightly/cu129 \
  --extra-index-url https://download.pytorch.org/whl/cu129 \
  --index-strategy unsafe-best-match
```

### Servir en 8× GPUs H200

```bash
vllm serve moonshotai/Kimi-K2.5 \
  -tp 8 \
  --mm-encoder-tp-mode data \
  --tool-call-parser kimi_k2 \
  --reasoning-parser kimi_k2 \
  --trust-remote-code \
  --gpu-memory-utilization 0.90
```

### Consultar con texto

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

response = client.chat.completions.create(
    model="moonshotai/Kimi-K2.5",
    messages=[
        {"role": "system", "content": "Eres Kimi, un asistente de IA creado por Moonshot AI."},
        {"role": "user", "content": "Escribe un servicio FastAPI con soporte WebSocket para chat en tiempo real"}
    ],
    temperature=0.6,
    max_tokens=4096
)
print(response.choices[0].message.content)
```

### Consultar con imagen (Multimodal)

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY", timeout=3600)

response = client.chat.completions.create(
    model="moonshotai/Kimi-K2.5",
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image_url",
                "image_url": {"url": "https://example.com/diagram.png"}
            },
            {
                "type": "text",
                "text": "Describe este diagrama en detalle y extrae todo el texto."
            }
        ]
    }],
    max_tokens=2048
)
print(response.choices[0].message.content)
```

## Acceso a la API (No se necesita GPU)

Si alojarlo uno mismo es excesivo, usa la API oficial de Moonshot:

```python
from openai import OpenAI

# Plataforma Moonshot — API compatible con OpenAI
client = OpenAI(
    api_key="tu-moonshot-api-key",
    base_url="https://api.moonshot.ai/v1"
)

response = client.chat.completions.create(
    model="kimi-k2.5",
    messages=[
        {"role": "user", "content": "Explica la arquitectura Agent Swarm en Kimi K2.5"}
    ],
    temperature=0.6,
    max_tokens=2048
)
print(response.choices[0].message.content)
```

## Llamada a herramientas

K2.5 sobresale en el uso agentivo de herramientas:

```python
import json
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

tools = [{
    "type": "function",
    "function": {
        "name": "search_code",
        "description": "Buscar en una base de código archivos y funciones relevantes",
        "parameters": {
            "type": "object",
            "required": ["query"],
            "properties": {
                "query": {"type": "string", "description": "Consulta de búsqueda"}
            }
        }
    }
}]

response = client.chat.completions.create(
    model="moonshotai/Kimi-K2.5",
    messages=[{"role": "user", "content": "Encuentra todo el código relacionado con autenticación en el proyecto"}],
    tools=tools,
    tool_choice="auto",
    temperature=0.6
)

for tool_call in response.choices[0].message.tool_calls:
    print(f"Function: {tool_call.function.name}")
    print(f"Args: {json.loads(tool_call.function.arguments)}")
```

## Inicio rápido con Docker

```bash
# Usando vLLM Docker con 8 GPUs
docker run --gpus all -p 8000:8000 \
  --ipc=host \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:latest \
  --model moonshotai/Kimi-K2.5 \
  --tensor-parallel-size 8 \
  --mm-encoder-tp-mode data \
  --tool-call-parser kimi_k2 \
  --reasoning-parser kimi_k2 \
  --trust-remote-code
```

## Consejos para usuarios de Clore.ai

* **Compensación API vs self-hosting**: K2.5 completo necesita 8× H200 a \~$24–48/día. La API de Moonshot tiene nivel gratuito o pago por token — usa la API para exploración, aloja tú mismo para cargas sostenidas en producción.
* **Cuantizado en GPU única**: El Unsloth GGUF Q2\_K\_XL (\~375GB) puede ejecutarse en una RTX 4090 ($0.5–2/día) con 256GB de RAM vía descarga a CPU — espera \~5–10 tok/s. Suficiente para uso personal y desarrollo.
* **K2 solo texto para configuraciones económicas**: Si no necesitas visión, `moonshotai/Kimi-K2-Instruct` es el predecesor solo de texto — mismo MoE de 1T pero más ligero de desplegar (sin sobrecarga del codificador de visión).
* **Ajusta la temperatura correctamente**: Usa `temperature=0.6` para modo instantáneo, `temperature=1.0` para modo de pensamiento. Una temperatura incorrecta provoca repetición o incoherencia.
* **Paralelismo de expertos para rendimiento**: En configuraciones multinodo, usa `--enable-expert-parallel` en vLLM para mayor rendimiento. Consulta la documentación de vLLM para la configuración de EP.

## Solución de problemas

| Problema                                  | Solución                                                                                             |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `OutOfMemoryError` con modelo completo    | Necesita 8× H200 (1128GB en total). Usa pesos FP8, configura `--gpu-memory-utilization 0.90`.        |
| GGUF inferencia muy lenta                 | Asegura suficiente RAM para el tamaño cuantizado. Q2\_K\_XL necesita \~375GB combinados de RAM+VRAM. |
| Visión no funciona en llama.cpp           | El soporte de visión para K2.5 GGUF no está disponible aún — usa vLLM para multimodal.               |
| Salida repetitiva                         | Establecer `temperature=0.6` (instantáneo) o `1.0` (pensamiento). Añade `min_p=0.01`.                |
| La descarga del modelo dura una eternidad | \~630GB checkpoint FP8. Usa `huggingface-cli download` con `--resume-download`.                      |
| Llamadas a herramientas no parseadas      | Agregar `--tool-call-parser kimi_k2 --enable-auto-tool-choice` al comando vLLM serve.                |

## Lecturas adicionales

* [Kimi K2.5 en HuggingFace](https://huggingface.co/moonshotai/Kimi-K2.5)
* [Blog técnico de Kimi K2.5](https://www.kimi.com/blog/kimi-k2-5.html)
* [Paper de Kimi K2.5](https://arxiv.org/abs/2602.02276)
* [Receta vLLM K2.5](https://docs.vllm.ai/projects/recipes/en/latest/moonshotai/Kimi-K2.5.html)
* [Cuantizaciones GGUF de Unsloth](https://huggingface.co/unsloth/Kimi-K2.5-GGUF)
* [Plataforma API de Moonshot](https://platform.moonshot.ai)
* [Kimi K2 GitHub](https://github.com/MoonshotAI/Kimi-K2)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-es/modelos-de-lenguaje/kimi-k2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
