THE MEDIA FOR AI THAT ACTUALLY HELPS.French edition · Understand & take action
The interface is in English. Use cases, skills and articles remain in French.
Hugging Face

Faire tourner un modèle en local (llama.cpp)

huggingface-local-models

En bref

La skill aide à choisir et à faire tourner un modèle en local avec llama.cpp et GGUF, sur CPU, Mac Metal, CUDA ou ROCm. Elle couvre la recherche de GGUF, le choix de quantification, le lancement de serveurs, la recherche exacte d’un fichier GGUF, la conversion, et un service local compatible OpenAI. On conserve les libellés natifs du dépôt (par exemple UD-Q4_K_M) au lieu de les normaliser, pour ne pas viser le mauvais fichier. Un flux par défaut et un démarrage rapide encadrent la sélection, puis les références de chargement. Ce n’est pas une estimation de mémoire (hf-mem), même si les deux se complètent, ni un déploiement SageMaker.

Ce que ça fait

  • Cible llama.cpp et GGUF en local, sur les backends CPU, Metal, CUDA ou ROCm.
  • Préserve les identifiants de quantification tels que le dépôt les nomme, pour retrouver le bon fichier.
  • Permet un serveur local à l’interface compatible OpenAI, une fois le GGUF choisi.
  • Peut s’appuyer, en amont, sur une estimation de mémoire, sans la remplacer.

Pour qui, et un exemple

Praticiens qui veulent servir un GGUF sur leur machine, avec une quantification claire et éventuellement une API compatible OpenAI.

Exemple de demande : On cherche un Qwen GGUF pour un Mac : la skill trouve le fichier, garde le libellé UD-Q4_K_M du dépôt, et lance un serveur llama.cpp compatible OpenAI sur Metal.

Quand on choisit ou fait tourner un modèle local avec llama.cpp et GGUF, que l’on sélectionne une quantification, ou que l’on sert une API locale compatible OpenAI. Exemple rédigé par iadujour.fr à partir du SKILL.md, non testé.

Installer

hf skills add huggingface-local-models (README) ; pour Codex, copier le dossier dans .agents/skills.

hf skills add huggingface-local-models

Fonctionne avec

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor

Source : README : « compatible with Claude Code, Codex, Gemini CLI, and Cursor ».

Niveau : Intermédiaire

Suppose un compte Hugging Face (jeton d’accès) et l’usage d’un terminal ou de Python.

Extrait du SKILL.md

La description d’origine, celle que l’agent lit pour décider de charger la skill (en anglais) :

Use to select models to run locally with llama.cpp and GGUF on CPU, Mac Metal, CUDA, or ROCm. Covers finding GGUFs, quant selection, running servers, exact GGUF file lookup, conversion, and OpenAI-compatible local serving.

Citée depuis le SKILL.md au commit 25910b3 . Le dossier contient aussi 3 fichiers annexes (references/).

Le SKILL.md compte 114 lignes et 5 sections principales :

  • Default Workflow
  • Quick Start
  • Quant Choice
  • Load References
  • Resources

Licence : Apache 2.0

Vérifiée le 10 novembre 2026 sur : fichier LICENSE du dépôt .

La licence autorise la reprise : le texte intégral du SKILL.md est reproduit ci-dessous, sans modification, avec sa mention de licence.

Texte intégral du SKILL.md

Reproduit sans modification depuis huggingface/skills (commit 25910b3) , © Hugging Face, sous licence Apache 2.0 (fichier de licence d’origine ).

Afficher le SKILL.md original (114 lignes, en anglais)
---
name: huggingface-local-models
description: "Use to select models to run locally with llama.cpp and GGUF on CPU, Mac Metal, CUDA, or ROCm. Covers finding GGUFs, quant selection, running servers, exact GGUF file lookup, conversion, and OpenAI-compatible local serving."
---

# Hugging Face Local Models

Search the Hugging Face Hub for llama.cpp-compatible GGUF repos, choose the right quant, and launch the model with `llama-cli` or `llama-server`.

## Default Workflow

1. Search the Hub with `apps=llama.cpp`.
2. Open `https://huggingface.co/<repo>?local-app=llama.cpp`.
3. Prefer the exact HF local-app snippet and quant recommendation when it is visible.
4. Confirm exact `.gguf` filenames with `https://huggingface.co/api/models/<repo>/tree/main?recursive=true`.
5. Launch with `llama-cli -hf <repo>:<QUANT>` or `llama-server -hf <repo>:<QUANT>`.
6. Fall back to `--hf-repo` plus `--hf-file` when the repo uses custom file naming.
7. Convert from Transformers weights only if the repo does not already expose GGUF files.

## Quick Start

### Install llama.cpp

```bash
brew install llama.cpp
winget install llama.cpp
```

```bash
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
make
```

### Authenticate for gated repos

```bash
hf auth login
```

### Search the Hub

```text
https://huggingface.co/models?apps=llama.cpp&sort=trending
https://huggingface.co/models?search=Qwen3.6&apps=llama.cpp&sort=trending
https://huggingface.co/models?search=<term>&apps=llama.cpp&num_parameters=min:0,max:24B&sort=trending
```

### Run directly from the Hub

```bash
llama-cli -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_M
llama-server -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_M
```

### Run an exact GGUF file

```bash
llama-server \
    --hf-repo unsloth/Qwen3.6-35B-A3B-GGUF \
    --hf-file Qwen3.6-35B-A3B-UD-Q4_K_M.gguf \
    -c 4096
```

### Convert only when no GGUF is available

```bash
hf download <repo-without-gguf> --local-dir ./model-src
python convert_hf_to_gguf.py ./model-src \
    --outfile model-f16.gguf \
    --outtype f16
llama-quantize model-f16.gguf model-q4_k_m.gguf Q4_K_M
```

### Smoke test a local server

```bash
llama-server -hf unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_M
```

```bash
curl http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer no-key" \
  -d '{
    "messages": [
      {"role": "user", "content": "Write a limerick about exception handling"}
    ]
  }'
```

## Quant Choice

- Prefer the exact quant that HF marks as compatible on the `?local-app=llama.cpp` page.
- Keep repo-native labels such as `UD-Q4_K_M` instead of normalizing them.
- Default to `Q4_K_M` unless the repo page or hardware profile suggests otherwise.
- Prefer `Q5_K_M` or `Q6_K` for code or technical workloads when memory allows.
- Consider `Q3_K_M`, `Q4_K_S`, or repo-specific `IQ` / `UD-*` variants for tighter RAM or VRAM budgets.
- Treat `mmproj-*.gguf` files as projector weights, not the main checkpoint.

## Load References

- Read [hub-discovery.md](references/hub-discovery.md) for URL-first workflows, model search, tree API extraction, and command reconstruction.
- Read [quantization.md](references/quantization.md) for format tables, model scaling, quality tradeoffs, and `imatrix`.
- Read [hardware.md](references/hardware.md) for Metal, CUDA, ROCm, or CPU build and acceleration details.

## Resources

- llama.cpp: `https://github.com/ggml-org/llama.cpp`
- Hugging Face GGUF + llama.cpp docs: `https://huggingface.co/docs/hub/gguf-llamacpp`
- Hugging Face Local Apps docs: `https://huggingface.co/docs/hub/main/local-apps`
- Hugging Face Local Agents docs: `https://huggingface.co/docs/hub/agents-local`
- GGUF converter Space: `https://huggingface.co/spaces/ggml-org/gguf-my-repo`
Source. Fiche rédigée par iadujour.fr à partir de : Frontmatter, sections et corps du SKILL.md, README du dépôt. Consultée le 10 novembre 2026. Dépôt : huggingface/skills .
MÊME ÉDITEUR

Autres skills Hugging Face : IA et apprentissage automatique

Toute la catégorie
Hugging FaceIA et apprentissage automatique

Piloter le Hub Hugging Face avec la CLI hf

hf-cli

Apprend à l’agent toutes les commandes de la CLI `hf` : télécharger et publier modèles, datasets et Spaces, gérer le cache, les buckets, les dépôts, les jobs, les articles, les webhooks et les Inference Endpoints.

Outils : Claude Code, Codex, Gemini CLI +1Niveau : Intermédiairemàj 29/10/2026
Hugging FaceIA et apprentissage automatique

Post-entraîner un LLM avec TRL

trl-training

La skill post-entraîne des LLM avec TRL (Transformers Reinforcement Learning) : SFT, DPO, GRPO, KTO et entraînement de modèle de récompense, que ce soit par l’API Python ou la CLI trl.

Outils : Claude Code, Codex, Gemini CLI +1Niveau : Avancémàj 01/10/2026
Hugging FaceIA et apprentissage automatique

Choisir le conteneur de service SageMaker

hf-cloud-serving-image-selection

La skill choisit le bon conteneur de service pour un déploiement SageMaker et en trouve l’URI d’image à jour, dès que l’on va poser un point de terminaison et qu’une image doit être choisie (LLM, modèle Hugging Face, fine-tune, embeddings, reranker, sentence-transformers), ou avant de figer un URI dans le code.

Outils : Claude Code, Codex, Gemini CLI +1Niveau : Avancémàj 10/09/2026
ÉCHANGES

Commentaires.

Un retour d’expérience, une question, une précision sur cette skill ? Les commentaires sont relus avant publication.

Commentaires publiés

Chargement des commentaires…

    Laisser un commentaire

    Charte de modération. Chaque commentaire est relu avant publication. Sont refusés : l’incitation à la haine, les propos injurieux ou discriminatoires, la publicité, le spam et les liens promotionnels, le hors-sujet et les données personnelles d’autrui.