Tools: what to use and when
The ecosystem is enormous and it changes every month. This document sorts it by what you want to do, not by popularity.
With a warning up front: the names age, the concepts do not. If a tool on this list disappears, its replacement will do the same thing under another name.
1. Running models on your machine
| Tool | What it is | When you want it |
|---|---|---|
| Ollama | a docker run for models. ollama run llama3 and you are off | getting started in 30 seconds, scripts, a local API |
| LM Studio | a desktop app with a graphical interface | exploring and comparing models without touching a terminal |
| llama.cpp | the C++ engine almost all of them run on | total control, CPU, custom quantization |
| Jan · GPT4All | open source desktop alternatives | privacy, no connection at all |
| MLX | Apple's framework for its own chips | a Mac with an M chip, maximum performance |
| vLLM | a high-performance inference server | serving several users at once |
What to choose: Ollama if you are going to program against it, LM Studio if you want to tinker. Both use llama.cpp underneath.
What you already know:
OllamaandLM Studioare, in essence, youretapas/08_inferencia/02_kv_cache.py+etapas/11_servidor_chat/servidor.py, with twenty person-years of optimization on top. The loop is the same.
The GGUF format and the odd names
You will see models called Q4_K_M, Q5_K_S, Q8_0. You already know how to read them:
| Label | Bits | Quality | When |
|---|---|---|---|
Q8_0 | 8 | practically identical | if you have memory to spare |
Q6_K | 6 | excellent | the sweet spot if it fits |
Q4_K_M | ~4.5 | very good | the de facto standard |
Q4_K_S | ~4.1 | good | if Q4_K_M just barely does not fit |
Q3_K_M | ~3.5 | you can tell | last resort |
Q2_K | ~2.6 | bad | almost never worth it |
The K means group-wise quantization, and you measured it yourself in stage 08.3: int4 per tensor breaks the model (+0.256 of loss), int4 in groups of 64 holds up (+0.027). That letter is the whole difference.
2. Getting models and data
| Tool | What it is | What for |
|---|---|---|
| Hugging Face Hub | the GitHub of AI: models, data, demos | the default place for everything |
transformers | the library that loads and runs almost any model | loading, fine-tuning, experimenting |
datasets | datasets with lazy loading and streaming | large data without filling your disk |
tokenizers | BPE tokenizers in Rust, extremely fast | production |
| Spaces | demos hosted free (Gradio, Streamlit) | showing something that works |
peft | LoRA, QLoRA and other efficient fine-tuning | fine-tuning without 8 GPUs |
trl | SFT, DPO, PPO already implemented | alignment without writing it yourself |
accelerate | abstracts CPU/GPU/multi-GPU | the same code running everywhere |
What you already know:
tokenizersis youretapas/01_tokenizador/bpe.pyin Rust.peftis youretapas/09_finetuning_lora/02_lora.py.trlis youretapas/10_alineamiento_dpo/01_dpo.py. You have written all of them.
3. Vector databases (for RAG)
| Tool | Type | When |
|---|---|---|
| FAISS | a library, in memory | prototypes, up to ~1 M vectors |
| Chroma | embedded, zero configuration | getting started. It is the SQLite of this |
| Qdrant · Weaviate | servers, with filters and metadata | production, self-hosted |
| Pinecone | a managed service | you do not want to operate anything |
| pgvector | a PostgreSQL extension | you already have Postgres. Start here |
| Elasticsearch · OpenSearch | hybrid search (text + vectors) | you need both |
The classic mistake: setting up a vector database for 500 documents. With fewer than a few thousand chunks, a NumPy array in memory is faster and you do not have to operate anything.
And remember what you measured in stage 12.1: TF-IDF, an algorithm from 1972, beat your GPT's embeddings 88% against 25%. Before building vector infrastructure, try keyword search. In production what almost always wins is hybrid: both, fused.
Embedding models (which are NOT LLMs)
| Model | Note |
|---|---|
| BGE-M3 · E5 · GTE | open, multilingual, very good |
text-embedding-3 (OpenAI) | paid, convenient, good quality |
| Cohere Embed | strong at multilingual |
| Reranker (BGE-reranker, Cohere Rerank) | reorders the top 20. It is the cheapest improvement in all of RAG |
4. Building applications and agents
| Tool | Approach | When |
|---|---|---|
| LangChain | complete, many integrations | rapid prototyping |
| LangGraph | explicit state graphs | flows with cycles and fine control |
| LlamaIndex | specialized in RAG | your problem is retrieval |
| CrewAI · AutoGen | multi-agent with roles | teams of agents |
| PydanticAI · Instructor | structured, typed output | you want strong validation |
| LiteLLM | one API for 100 providers | switching models without touching code |
| MCP SDK | connecting tools in a standard way | reusable integrations |
| nothing | your own loop | start here |
The loop in your stage 12 is 30 lines. Adopt a framework when something specific starts to hurt, not before.
5. Training and fine-tuning
| Tool | What it does | When |
|---|---|---|
| PyTorch | the de facto standard | everything |
| Axolotl · LLaMA-Factory | fine-tuning from a config file | fine-tuning without writing the loop |
| Unsloth | LoRA 2-5× faster, less memory | a single GPU |
| DeepSpeed · FSDP | distributed training, ZeRO | several GPUs |
| Megatron-LM | serious tensor parallelism | genuine pre-training |
| Weights & Biases · MLflow | experiment tracking | from day one |
| Modal · RunPod · Lambda | GPUs by the hour | you do not have hardware |
docs/12-entrenamiento-distribuido.mdexplains what ZeRO does inside. Once you have read that, a DeepSpeed configuration stops being magic.
6. Evaluating and monitoring
The most ignored category and the one that prevents the most problems.
| Tool | What for |
|---|---|
| LangSmith · Langfuse | traces, cost and latency of every call |
| Ragas | RAG-specific metrics (faithfulness, relevance) |
| DeepEval · promptfoo | automated prompt testing |
| lm-evaluation-harness | the standard benchmarks |
| Phoenix (Arize) | observability, open source |
And remember what docs/05 said: public benchmarks are contaminated. Your real evaluation is 50 examples from your case, published nowhere.
7. Closed model APIs
| Provider | Strong at |
|---|---|
| Anthropic (Claude) | long reasoning, code, following instructions |
| OpenAI (GPT) | ecosystem, tooling, multimodal |
| Google (Gemini) | enormous context, multimodal |
| Mistral | European, good value |
| Groq · Together · Fireworks | extremely fast inference of open models |
Cost rule: always start with the most capable model so that it works, and then come down to the cheapest one that still passes your evaluations. The other way round wastes an enormous amount of time.
8. What to use in each case
| I want to... | Use |
|---|---|
| Try an open model right now | Ollama |
| Compare models with a UI | LM Studio |
| A chatbot over my documents | LlamaIndex or pgvector + a reranker |
| A product with an API | LiteLLM + your own code |
| Specialize a model in my domain | Unsloth or Axolotl with LoRA |
| Serve many users | vLLM |
| Know whether my change improved anything | promptfoo + your own cases |
| See what each query costs | Langfuse |
| Train from scratch | PyTorch + FSDP + a lot of money |
| Understand what happens inside | this project |
Three pieces of advice that save months
1. Do not adopt a framework before you have the problem. Somebody else's abstractions force you to think the way they do. Start with direct calls.
2. Instrument from day one. Logging prompt, response, tokens, cost and latency takes twenty lines. Without it, two months from now you will not know why something got worse.
3. Evaluate before optimizing. "This model is better" with no test is an opinion. With a 50-case test of your own, it is a fact.
Next: 16-terminos-actuales.md