Logo : Inference And Endpoints

Inference And Endpoints

Organisation
VectorSpaceLab
inference-and-endpoints

Run hosted model inference and manage Hugging Face Inference Endpoints with sync or async clients, provider-aware payloads, streaming, tools, structured outputs, MCP, and safe lifecycle recovery.

Add to TypingMind

Présentation

ÉditeurVectorSpaceLab
DépôtAREX-Skill
Nom de la compétenceinference-and-endpoints
Étoiles
341
Forks
26
Fichiers inclus
7
LicenceApache-2.0
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 7

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par VectorSpaceLab sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Inference And Endpoints dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/VectorSpaceLab/AREX-Skill/tree/main/examples/creator/repo-to-skills/artifacts/huggingface_hub/huggingface-hub/sub-skills/inference-and-endpoints
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/VectorSpaceLab/AREX-Skill.git /tmp/AREX-Skill
mkdir -p .claude/skills
cp -r /tmp/AREX-Skill/examples/creator/repo-to-skills/artifacts/huggingface_hub/huggingface-hub/sub-skills/inference-and-endpoints .claude/skills/inference-and-endpoints
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Inference And Endpoints dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Inference And Endpoints dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Inference And Endpoints n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Inference And Endpoints

Use this route for hosted inference through InferenceClient or AsyncInferenceClient, a provider/token/base URL decision, task payloads or binary media, OpenAI-compatible chat, streaming, tools or structured JSON, MCP client/agent workflows, or the deployment and lifecycle of an Inference Endpoint. This skill targets huggingface_hub 1.29.0 evidence.

Route Before Calling

RequestRoute
Serverless Hub/provider predictionInferenceClient or AsyncInferenceClient; read providers and tasks.
Dedicated HF-managed deploymentHfApi/root endpoint helpers and InferenceEndpoint; read workflows.
Chat with an OpenAI-shaped APIclient.chat.completions.create, an alias of chat_completion.
Tools, function calls, JSON mode, or schema outputChat route plus task types and provider caveats.
MCP servers or a tiny tool-using agentInstall the optional mcp extra, then read workflows.
Local vLLM/TGI/Ollama/LiteLLM serverUse model/base_url as an OpenAI-compatible URL; this route does not install or run the server.
Hub repositories, downloads, jobs, Spaces, or CLI output in generalUse the sibling sub-skill rather than this route.

Do not confuse InferenceClient (an HTTP prediction client for the HF router, providers, deployed URLs, or compatible servers) with InferenceEndpoints API methods (deployment configuration and lifecycle). An Inference Endpoint can later be used as the client's URL.

Safe Setup And Identity

  • Base hosted inference needs the package and its HTTP dependencies; it does not require a local GPU, CUDA, torch, or model download. Install only what the requested surface needs: pip install "huggingface_hub", pip install Pillow to decode image outputs, pip install numpy for embedding arrays, or pip install "huggingface_hub[mcp]" before connecting to MCP servers. There is no runtime inference extra; the repository's testing extra is for maintainers, not application setup.
  • Keep credentials out of prompts, request bodies, logs, notebooks, and examples. Prefer a secret manager or HF_TOKEN/an existing hf auth login; pass a placeholder in documentation. A Hugging Face hf_... key uses HF routing/billing; a provider key uses direct provider access. bill_to only applies to an eligible HF organization and is ignored for external keys.
  • Resolve model identity before the request: a Hub model ID must support the selected task, and a third-party provider route also needs a compatible provider mapping; a deployed/local URL is a direct target. With a model ID, provider="auto" selects from mapped providers (chat uses the server-side auto-router). With no model, None or "auto" falls back to the recommended hf-inference model for that task. A URL is direct and should not be paired with a provider. Pin model explicitly for repeatability.
  • model and base_url are constructor aliases and mutually exclusive, as are token and api_key. For chat, a URL supplied by either constructor name is normalized to a /v1/chat/completions route unless it already ends in /chat/completions; other tasks use the URL unchanged. The implementation stores either constructor spelling identically; base_url is the OpenAI-compatible name. With a constructor URL and a call-time model=, the URL remains the transport target and the call-time value becomes the JSON payload model.
  • Set timeout when a bounded request is required. None means no client-side request deadline. Use one client per configured identity and close it, especially the async client and any partially consumed stream.

Read API reference for inspected signatures, return types, endpoint classes, and sync/async parity before coding.

Task And Output Workflow

  1. Select a task family and a model/provider combination from providers and tasks; do not assume every provider supports every task.
  2. Construct the task-specific input. Text tasks take strings or batches; vision/audio tasks accept bytes, binary file objects, Path, URL, or PIL input where supported. A string is a URL or path, not raw binary content.
  3. Call the typed method. Representative contracts are text_generation (string, detailed output, or iterable), chat_completion (output object or stream), feature_extraction (numpy.ndarray), and text_to_image (PIL.Image). Task types covers generated dataclasses and payload shapes without making the router a catalog.
  4. For stream=True, consume synchronously with for or asynchronously with async for over the awaited async result. Chat deltas may contain content, reasoning, tool-call fragments, finish reasons, or a usage-only final chunk; do not assume every chunk has content.
  5. Record model, provider mode, task, non-secret request ID/status, output shape, and typed exception. Never record authorization headers or raw private media.

text_generation is for a prompt. Use chat for message history so the client and server apply the model's chat format. details=True and detailed stream objects are backend-dependent, especially for TGI. Provider-specific options belong in extra_body only after checking that provider's contract.

Chat, Tools, And Structured Output

Use OpenAI-shaped messages with valid roles and content. Function tools are schemas, not executable Python: validate names and JSON arguments yourself, apply least privilege, and only execute an approved function after checking its arguments. tool_choice may be "auto", "none", "required", or a provider-supported named function object. Provider/model support is not uniform; see providers and tasks.

Use response_format={"type": "json_object"} for valid JSON where supported, or {"type": "json_schema", "json_schema": {"name": ..., "schema": ..., "strict": True}} for schema-constrained output. Keep the schema finite, valid JSON Schema, and aligned with the prompt. Parse and validate the returned message content; a response-format request is not a substitute for validation. For HF Inference, the implementation translates JSON schema to its supported grammar form, so check the provider before relying on strict behavior.

OpenAI migration requires replacing the import/client and selecting a valid HF model/provider or compatible URL; it is not a promise that every OpenAI parameter or provider feature is portable. client.chat.completions.create is an alias, not a separate transport.

Async And MCP

AsyncInferenceClient has the same representative input signatures and returns awaitables or AsyncIterable streams. Run it inside an asyncio context, await ordinary calls and the stream-producing call, then cancel or close the consumer on early termination. Do not use synchronous iteration on an async stream.

MCP is experimental and optional. Importing the public class can succeed without the optional dependency because the MCP package is loaded when a server connection is opened; install the mcp extra before using that path. MCPClient can attach stdio, sse, or streamable http servers, discover allowed tools, stream a turn, and execute a tool only through the session that registered its name. Agent wraps a bounded MCP loop. Use placeholder URLs/commands, an explicit narrow allowed_tools list (empty to expose none), isolated working directories, and explicit headers; never put real credentials in a sample or allow an untrusted stdio command. Use an async context manager and call cleanup on manual paths.

Endpoint Lifecycle

Use list_inference_endpoints_hardware first to resolve valid vendor, region, accelerator, instance type/size and quota. Then create with create_inference_endpoint (or the experimental catalog helper), inspect the returned InferenceEndpoint, and wait for a healthy running state before accessing .client/.async_client. wait(timeout=..., refresh_every=...) mutates the object and raises typed endpoint errors on failure or timeout.

The object aliases fetch, update, pause, resume, scale_to_zero, and delete to HfApi operations; root helpers are also available. Paused endpoints need explicit resume; scaled-to-zero endpoints restart on request with cold start. Delete is irreversible. Treat secrets and custom image credentials as write-only. For engine images, parallelism belongs in the image config; container_args are engine flags and are not equivalent. See workflows.

Diagnose And Verify

Start with the exact signature and selected task/provider, then inspect the prepared request only with a mock transport. A missing token/provider mapping, unsupported task/provider, malformed messages/tools/schema, binary MIME/path, stream event, timeout/rate-limit, billing, endpoint state, or custom-image error should be diagnosed using troubleshooting. Use typed errors and bounded recovery; do not blindly retry non-idempotent endpoint mutations or repeat paid inference.

No live inference, model download, deployment, or endpoint deletion is part of this skill verification. Run the safe synthetic transport case instead:

bash
PYTHONPATH=src python skills/huggingface-hub/sub-skills/inference-and-endpoints/scripts/mock_chat_recovery.py
# In an installed-package project, omit `PYTHONPATH=src`.

The script asserts no real network or token use while exercising chat tools and JSON schema, async stream cancellation, and an explicit provider fallback. Native VCR/production tests cover individual payloads and recorded services, not this full cross-provider recovery/cancellation composition; its limitation is documented in the script and workflows.

Progressive Disclosure

  • api-reference.md — verified constructors, representative task signatures, output types, endpoint APIs, and aliases.
  • workflows.md — safe mocked client flows, async streaming/cancellation, MCP setup, endpoint planning, and hf endpoints --help discovery.
  • providers-and-tasks.md — provider/task matrix, routing semantics, billing and capability caveats.
  • task-types.md — generated type system and practical text/chat/binary/embedding payload shapes.
  • troubleshooting.md — typed failure diagnosis and narrow recovery for all supported surfaces.
  • development.md — maintainer-only generated-file policy; never ask runtime users to invoke source generators.

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA Inference And Endpoints ?

Run hosted model inference and manage Hugging Face Inference Endpoints with sync or async clients, provider-aware payloads, streaming, tools, structured outputs, MCP, and safe lifecycle recovery.

Pourquoi utiliser Inference And Endpoints sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Inference And Endpoints se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Inference And Endpoints dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/VectorSpaceLab/AREX-Skill/tree/main/examples/creator/repo-to-skills/artifacts/huggingface_hub/huggingface-hub/sub-skills/inference-and-endpoints. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Inference And Endpoints ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Inference And Endpoints ?

Autant que vous le souhaitez. Vous pouvez utiliser Inference And Endpoints avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Inference And Endpoints est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par VectorSpaceLab sous licence Apache-2.0. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇