# nexttoken.lat > Bilingual compendium (ES default, EN) on how language models work — the mechanism first, then production engineering. Written by Nelson Zepeda. The live site is https://nexttoken.lat. Spanish is the default locale (`/es/fundamentos/...`, `/es/ingenieria/...`, `/es/claude-ops/...`). English uses translated segments (`/en/fundamentals/...`, `/en/engineering/...`, `/en/infrastructure/...`, `/en/case-studies/...`, `/en/claude-ops/...`). Sitemap: https://nexttoken.lat/sitemap.xml ## Español ### Inicio - [Portada](https://nexttoken.lat/es/): Compendio de fundamentos e ingeniería de IA. - [Contacto](https://nexttoken.lat/es/contacto): Conversar sobre arquitectura de IA. ### Parte I: Fundamentos - [Introducción](https://nexttoken.lat/es/fundamentos/introduccion): ¿Qué sabes realmente sobre inteligencia artificial, más allá de saber usar Claude, ChatGPT, o Gemini? Este compendio existe para cerrar esa distancia: qué es un LLM, qué no es el producto que usas, y el camino del mecanismo a la operación. - [¿Qué es un modelo de lenguaje?](https://nexttoken.lat/es/fundamentos/que-es-un-modelo-de-lenguaje): Un modelo de lenguaje es un predictor del siguiente token. Este capítulo construye esa idea desde el conteo de n-gramas hasta por qué los transformers reemplazaron a las RNN. - [Tokenización](https://nexttoken.lat/es/fundamentos/tokenizacion): Un modelo de lenguaje no puede leer texto: solo opera sobre números. Este capítulo explica qué es un token, por qué BPE fusiona pares frecuentes, y cómo el marcador · distingue el inicio de cada palabra. - [Embeddings: de identificadores a vectores con significado](https://nexttoken.lat/es/fundamentos/embeddings): Un ID como 5089 no le dice nada al modelo sobre el significado de una palabra. El embedding convierte ese identificador en un vector, y durante el entrenamiento esos vectores se organizan en un espacio semántico. - [Anatomía de un transformer: el cerebro detrás de la IA generativa](https://nexttoken.lat/es/fundamentos/anatomia-de-un-transformer): Hasta ahora hemos recorrido el camino de transformar texto en números. Esos vectores, por sí solos, no generan texto: necesitan un procesador. Esa máquina es el transformer — pocas piezas, y la más importante se repite. - [Datos de entrenamiento: el combustible del aprendizaje](https://nexttoken.lat/es/fundamentos/datos-de-entrenamiento): Una máquina, por sí sola, no sabe nada. Este capítulo cubre de dónde sale el texto que alimenta a un modelo, cómo se limpia, cuánto se necesita, y por qué Llama 3 entrenó muy por encima de la regla Chinchilla. - [Cómo aprenden los modelos: el viaje de los números hacia la inteligencia](https://nexttoken.lat/es/fundamentos/como-aprenden-los-modelos): Cómo pasa un modelo de ser un montón de números aleatorios a generar texto: función de pérdida, descenso de gradiente, retropropagación, validación y AdamW. - [Cómo aprenden comportamiento: de predictor de texto a asistente útil](https://nexttoken.lat/es/fundamentos/como-aprenden-comportamiento): El preentrenamiento da conocimiento, pero no comportamiento confiable. SFT enseña formato y estilo; DPO moldea preferencias mediante comparaciones humanas. ### Parte II: Ingeniería - [Límites del modelo base: por qué los LLMs necesitan ingeniería a su alrededor](https://nexttoken.lat/es/ingenieria/limites-del-modelo-base): Los modelos base son capaces, pero tienen límites de conocimiento, actualidad, control, precisión, contexto, costo y razonamiento. La ingeniería de IA consiste en diseñar alrededor de ellos. - [Prompt engineering básico](https://nexttoken.lat/es/ingenieria/prompt-engineering-basico): La forma más rápida y barata de mejorar el comportamiento de un modelo, sin tocar sus pesos, es diseñar mejor sus instrucciones: zero-shot, few-shot, Chain-of-Thought y prompt chaining. - [Jueces LLM y evaluación de prompts](https://nexttoken.lat/es/ingenieria/jueces-llm): Retomemos algo del capítulo anterior. Armamos dos versiones de un clasificador de opiniones (zero-shot y few-shot) y dijimos que el few-shot "funciona mejor" — pero hicimos esa afirmación con un solo ejemplo. Aquí está… - [Por qué (normalmente) NO hacer fine-tuning](https://nexttoken.lat/es/ingenieria/por-que-no-hacer-fine-tuning): Fine-tuning parece una solución intuitiva para adaptar un modelo, pero su costo real incluye datos, entrenamiento, evaluación e iteración. Cuándo evitarlo, qué puede salir mal y cuándo sí se justifica. - [LoRA vs. QLoRA — fine-tuning eficiente en parámetros](https://nexttoken.lat/es/ingenieria/lora-vs-qlora): Vale la pena ser precisos aquí, porque es un punto donde es fácil confundirse: LoRA y QLoRA son fine-tuning — no una alternativa separada a él, sino una familia de estrategias dentro de - [RAG (Retrieval-Augmented Generation)](https://nexttoken.lat/es/ingenieria/rag): RAG es la alternativa más común al fine-tuning para el problema de "falta de conocimiento del dominio" que vimos en el Capítulo 1. En lugar de meter la información dentro de los pesos del modelo, le damos al modelo un… - [Bases de datos vectoriales a fondo: el corazón de RAG](https://nexttoken.lat/es/ingenieria/bases-de-datos-vectoriales): Cómo las bases de datos vectoriales hacen viable RAG a escala: HNSW, cuantización, filtros, multimodalidad, control de acceso e implementación práctica con Qdrant. - [Protocolo de Contexto de Modelo (MCP) a fondo](https://nexttoken.lat/es/ingenieria/mcp): Cómo MCP estandariza la conexión entre aplicaciones de IA y sistemas externos: arquitectura, herramientas, seguridad, implementación y adopción en el ecosistema. - [Flujos agénticos: cuando la IA orquesta su propio camino](https://nexttoken.lat/es/ingenieria/flujos-agenticos): Qué distingue a un agente de un pipeline fijo: prompts, memoria, herramientas, autonomía y el bucle de percepción, razonamiento, acción y evaluación. - [Patrones de diseño de arquitectura agéntica](https://nexttoken.lat/es/ingenieria/patrones-de-arquitectura-agentica): Fuente: Google Cloud Architecture Center — "Choose a design pattern for your agentic AI - [Sistemas multi-agente: caso aplicado de domótica](https://nexttoken.lat/es/ingenieria/sistemas-multi-agente): Caso aplicado de un sistema multi-agente para domótica: descomposición jerárquica, ejecución paralela, confianza entre agentes y evolución gradual. - [Cierre de Parte II — el patrón que se repite: autonomía y verificación crecen juntas](https://nexttoken.lat/es/ingenieria/cierre-parte-2): Cierre de Parte II: cada incremento de capacidad y autonomía exige una verificación más rigurosa. ### Parte III: Infraestructura - [Cuántos tokens por segundo necesitas realmente — y por qué esa no es la pregunta correcta](https://nexttoken.lat/es/infraestructura/tokens-por-segundo): Cómo evaluar velocidad, latencia, hardware y costo de inferencia más allá de los tokens por segundo. - [Optimización de inferencia: cómo servir modelos más rápido y más barato](https://nexttoken.lat/es/infraestructura/optimizacion-de-inferencia): Cuatro técnicas complementarias para reducir la latencia, el costo y la memoria de inferencia. - [Latency, throughput, rate limits y batch — cómo se relacionan en producción](https://nexttoken.lat/es/infraestructura/latency-throughput-batch): Estos cuatro conceptos se confunden constantemente porque están entrelazados, pero cada uno responde una pregunta - [El trilema de la inferencia: latencia, throughput y costo — el arte de elegir qué sacrificar](https://nexttoken.lat/es/infraestructura/el-trilema-de-la-inferencia): Cómo equilibrar latencia, throughput y costo al desplegar modelos de lenguaje en producción. - [Observabilidad de LLMs y Evaluation-Driven Development (EDD): cómo saber si tu agente realmente funciona](https://nexttoken.lat/es/infraestructura/observabilidad-edd): Cómo pasar del monitoreo de sistemas a Evaluation-Driven Development y observabilidad agéntica. - [Seguridad y resiliencia en sistemas agénticos: cuando la autonomía se convierte en riesgo](https://nexttoken.lat/es/infraestructura/seguridad-sistemas-agenticos): Cómo se convierte la autonomía agéntica en superficie de ataque, y cómo diseñar defensas que realmente funcionen. ### Parte IV: Casos - [De 10 usuarios de negocio a 1,500 vendedores: el viaje arquitectónico de un sistema de IA que crece con la empresa](https://nexttoken.lat/es/casos/de-10-usuarios-a-1500-vendedores): Caso de estudio de arquitectura evolutiva: de un piloto con 10 vendedores a un sistema de producción usado por 1,500. ### Parte V: Claude Ops - [Dos formas de correr Claude Desktop en tu organización](https://nexttoken.lat/es/claude-ops/claude-desktop-team-vs-bedrock): Cómo decidir entre Claude Team y Amazon Bedrock para correr Claude Desktop y Claude Code en tu organización — con árboles de decisión y capturas reales de configuración. ## English ### Home - [Home](https://nexttoken.lat/en/): Compendium of AI foundations and engineering. - [Contact](https://nexttoken.lat/en/contact): Talk about AI architecture. ### Part I: Foundations - [Introduction](https://nexttoken.lat/en/fundamentals/introduction): What do you actually know about artificial intelligence, beyond knowing how to use Claude, ChatGPT, or Gemini? This compendium exists to close that gap: what an LLM is, why it is not the product you use, and the path from the mechanism to operations. - [What is a language model?](https://nexttoken.lat/en/fundamentals/what-is-a-language-model): A language model is a next-token predictor. This chapter builds that idea from n-gram counting up to why transformers replaced RNNs. - [Tokenization](https://nexttoken.lat/en/fundamentals/tokenization): A language model cannot read text: it only operates on numbers. This chapter explains what a token is, why BPE merges frequent pairs, and how the · marker distinguishes the start of each word. - [Embeddings: from identifiers to vectors with meaning](https://nexttoken.lat/en/fundamentals/embeddings): An ID like 5089 tells the model nothing about what a word means. The embedding turns that identifier into a vector, and during training those vectors organize themselves into a semantic space. - [Anatomy of a transformer: the brain behind generative AI](https://nexttoken.lat/en/fundamentals/anatomy-of-a-transformer): So far we have walked the path from text to numbers. Those vectors, on their own, do not generate text: they need a processor. That machine is the transformer — a few pieces, and the most important one repeats. - [Training data: the fuel of learning](https://nexttoken.lat/en/fundamentals/training-data): A machine, on its own, knows nothing. This chapter covers where the text that feeds a model comes from, how it is cleaned, how much you need, and why Llama 3 trained far above the Chinchilla rule. - [How models learn: the journey from numbers to intelligence](https://nexttoken.lat/en/fundamentals/how-models-learn): How a model goes from being a pile of random numbers to generating text: loss function, gradient descent, backpropagation, validation, and AdamW. - [How models learn behavior: from text predictor to useful assistant](https://nexttoken.lat/en/fundamentals/how-models-learn-behavior): Pretraining gives knowledge, but not reliable behavior. SFT teaches format and style; DPO shapes preferences through human comparisons. ### Part II: Engineering - [Base-model limits: why LLMs need engineering around them](https://nexttoken.lat/en/engineering/base-model-limitations): Base models are capable, but they have limits of knowledge, freshness, control, precision, context, cost, and reasoning. AI engineering is about designing around them. - [Basic prompt engineering](https://nexttoken.lat/en/engineering/basic-prompt-engineering): The fastest, cheapest way to improve a model's behavior, without touching its weights, is to design better instructions: zero-shot, few-shot, Chain-of-Thought, and prompt chaining. - [LLM judges and prompt evaluation](https://nexttoken.lat/en/engineering/llm-judges): Let's pick up something from the previous chapter. We built two versions of a review classifier (zero-shot and few-shot) and said few-shot "works better" — but we made that claim with a single example. Here is… - [Why (Usually) NOT to Fine-Tune](https://nexttoken.lat/en/engineering/why-not-to-fine-tune): Fine-tuning looks like the intuitive way to adapt a model, but the real cost includes data, training, evaluation, and iteration. When to avoid it, what can go wrong, and when it actually pays off. - [LoRA vs. QLoRA — Parameter-Efficient Fine-Tuning](https://nexttoken.lat/en/engineering/lora-vs-qlora): It's worth being precise here, because this is a point where it's easy to get confused: LoRA and QLoRA are fine-tuning — not separate alternatives to it, but a family of strategies inside - [RAG (Retrieval-Augmented Generation)](https://nexttoken.lat/en/engineering/rag): RAG is the most common alternative to fine-tuning for the missing-domain-knowledge problem from Chapter 1. Instead of baking the information into the model's weights, we give the model an open book to search before it answers. - [Vector Databases in Depth: The Heart of RAG](https://nexttoken.lat/en/engineering/vector-databases): How vector databases make RAG viable at scale: HNSW, quantization, filters, multimodality, access control, and a practical implementation with Qdrant. - [Model Context Protocol (MCP) In Depth](https://nexttoken.lat/en/engineering/mcp): How MCP standardizes the connection between AI applications and external systems: architecture, tools, security, implementation, and adoption across the ecosystem. - [Agentic Flows: When AI Orchestrates Its Own Path](https://nexttoken.lat/en/engineering/agentic-flows): What sets an agent apart from a fixed pipeline: prompts, memory, tools, autonomy, and the perceive–reason–act–evaluate loop. - [Agentic Architecture Design Patterns](https://nexttoken.lat/en/engineering/agentic-architecture-patterns): How to choose a design pattern for an agentic system: sequential, parallel, loop, coordinator, ReAct, swarm, and a decision table with relative latency and cost metrics. - [Multi-Agent Systems: Applied Smart-Home Case](https://nexttoken.lat/en/engineering/multi-agent-systems): An applied multi-agent case for home automation: hierarchical decomposition, parallel execution, trust between agents, and gradual evolution. - [Part II Close — The Pattern That Repeats: Autonomy and Verification Grow Together](https://nexttoken.lat/en/engineering/part-2-summary): Part II close: every increase in capability and autonomy demands more rigorous verification. ### Part III: Infrastructure - [How Many Tokens Per Second You Actually Need — And Why That Is the Wrong Question](https://nexttoken.lat/en/infrastructure/tokens-per-second): How to evaluate inference speed, latency, hardware, and cost beyond tokens per second. - [Inference Optimization: How to Serve Models Faster and Cheaper](https://nexttoken.lat/en/infrastructure/inference-optimization): Four complementary techniques to cut inference latency, cost, and memory. - [Latency, Throughput, Rate Limits, and Batch — How They Relate in Production](https://nexttoken.lat/en/infrastructure/latency-throughput-batch): These four concepts get confused constantly because they are entangled, but each one answers a - [The Inference Trilemma: Latency, Throughput, and Cost — The Art of Choosing What to Sacrifice](https://nexttoken.lat/en/infrastructure/inference-trilemma): How to balance latency, throughput, and cost when deploying language models in production. - [LLM Observability and Evaluation-Driven Development (EDD): How to Know If Your Agent Actually Works](https://nexttoken.lat/en/infrastructure/llm-observability-eval-driven-development): How to move from systems monitoring to Evaluation-Driven Development and agentic observability. - [Security and Resilience in Agentic Systems: When Autonomy Becomes Risk](https://nexttoken.lat/en/infrastructure/agentic-systems-security): How agentic autonomy becomes an attack surface, and how to design defenses that actually work. ### Part IV: Case studies - [From 10 Business Users to 1,500 Salespeople: The Architectural Journey of an AI System That Grows With the Company](https://nexttoken.lat/en/case-studies/scaling-to-1500-sales-reps): An evolutionary architecture case study: from a 10-salesperson pilot to a production system used by 1,500. ### Part V: Claude Ops - [Two ways to run Claude Desktop in your organization](https://nexttoken.lat/en/claude-ops/two-ways-to-run-claude-desktop): How to choose between Claude Team and Amazon Bedrock to run Claude Desktop and Claude Code in your organization — with decision trees and real configuration screenshots.