Xpu Model Type Detect logo

Xpu Model Type Detect

Organization
intel
xpu-model-type-detect

Before loading a Hugging Face model on Intel XPU, detect its actual type (text generation, text encoder, seq2seq, vision classification, vision-language, audio encoder, audio seq2seq, multimodal VL, diffusion, time-series, reward model, masked LM) so the agent picks the right `AutoModel` class and input kwargs. Prevents "got unexpected keyword argument 'pixel_values'" and "empty logits" errors from mis-routing. Use before `torch-xpu-run` or `vllm-xpu-run` when the user gives a model id the agent hasn't seen before, or when a smoke test fails with a wrong-input signature.

Overview

Publisherintel
Repositoryskills
Skill namexpu-model-type-detect
Stars
31
Forks
14
Bundled files
1
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by intel on GitHub. Read the source before you install it.

Installation

Install the Xpu Model Type Detect AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/intel/skills/tree/main/skills/xpu-model-type-detect
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/intel/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/xpu-model-type-detect .claude/skills/xpu-model-type-detect
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Xpu Model Type Detect in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Xpu Model Type Detect on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Xpu Model Type Detect is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

xpu-model-type-detect

Pick the right loader class before you load. A wrong loader class produces an opaque failure after the model is already on XPU — 20+ seconds into a load you didn't need to make.

Reporting the verdict

Run scripts/detect.py against the model id rather than answering its type from memory — even for a familiar model, the detector's verdict is the citable result. Then paste its output block verbatim in a fenced code block, keeping the detected:, loader:, inputs:, and confidence: lines as-is rather than reformatting them into a table — those literal labels are what the user and downstream tools key on. Lead with the confirmed type, e.g. "detection confirmed: multimodal_vl", to show the verdict came from the run.

Detection is read-only, so there's nothing to health-check afterward — confirming the verdict block is the result.

Quickstart

sh
python3 scripts/detect.py --model openai/clip-vit-base-patch32
model_id:    openai/clip-vit-base-patch32
detected:    vision_language
loader:      transformers.CLIPModel
processor:   transformers.AutoProcessor
inputs:      pixel_values, input_ids
rationale:   architectures[0]=CLIPModel; text + vision towers detected

Stdlib only. HF_TOKEN needed for gated repos.

With --json the output is a single JSON object suitable for piping into another tool.

3-stage detection

The script tries three signals in order; first hit wins.

  1. Name pattern on model_id — cheapest. Currently catches reward models (*-rm, *-reward), embedding repos (*-embed*, bge-, gte-, e5-, jina-embed*), and incompatible checkpoints (*-mlx*, *-gguf*).
  2. config.architectures[0] — authoritative when present. Pulled directly from config.json on the Hub (no weight download). This is where most non-name-matched models classify.
  3. HF Hub pipeline_tag — last resort; one HTTP call to /api/models/<id>.

If all three miss, the script prints unknown and suggests reading the model card's first usage snippet.

Types and their loaders

Detected typeLoader classInput kwargsTypical hit signal
text_generationAutoModelForCausalLMinput_ids, attention_mask*CausalLM, *LMHeadModel (decoder-only LLM architectures)
seq2seqAutoModelForSeq2SeqLMinput_ids, decoder_input_ids*Seq2SeqLM, *ForConditionalGeneration (T5, BART, MBart)
masked_lmAutoModelForMaskedLMinput_ids*ForMaskedLM
text_encoderAutoModel + mean-pool last_hidden_stateinput_ids, attention_maskBertModel, RobertaModel, DebertaModel, XLMRobertaModel, name *-embed*, *-bge*
vision_language (CLIP family)CLIPModel / SigLIPModel + AutoProcessorpixel_values, input_idsCLIPModel, SiglipModel, both vision and text towers
vision_classificationAutoModelForImageClassification + AutoImageProcessorpixel_values*ForImageClassification, ViTModel, Swin*, ConvNext*
audio_encoderAutoModel + AutoFeatureExtractorinput_valuesWav2Vec2Model, HubertModel, WavLMModel
audio_seq2seqAutoModelForSpeechSeq2Seqinput_features, decoder_input_idsWhisperForConditionalGeneration
multimodal_vlAutoModelForVision2Seq + AutoProcessorpixel_values, input_idsLlavaForConditionalGeneration, Qwen2VLForConditionalGeneration, Gemma3ForConditionalGeneration
reward_modelfast-fail; no smoke testn/a*ForScore, name *-rm, *-reward
diffusionDiffusionPipeline (diffusers)promptmodel_index.json at repo root
time_seriesAutoModelpast_values, past_time_featuresChronos, PatchTST, *ForTimeSeriesForecasting

Gotchas

  • Sentence-Transformers repos often have architectures[0] = BertModel but the intended usage is AutoModel + mean pooling — not AutoModelForSequenceClassification. The detector catches this via the canonical modules.json marker file (every ST repo has it; config_sentence_transformers.json is checked as a secondary marker) and returns text_encoder.
  • CLIP variants with only vision_model (e.g. pure ViT CLIP vision-encoder releases) classify as vision_classification, not vision_language.
  • Reward models look like classifiers but the output is a scalar score, not class logits. Agents should skip smoke tests and tell the user reward models aren't meant for conversational use.
  • Time-series models (Chronos, PatchTST) don't take input_ids at all — don't try to tokenise text for them.
  • Diffusion repos have no top-level config.json; the detector looks for model_index.json. Route these to torch-xpu-bench for sizing (VRAM depends on resolution × steps × scheduler).

When auto-detect is wrong

The detector is conservative. If it returns unknown, or the user confirms the suggested loader is wrong:

  1. Open the model card (README.md in the HF repo); read the first usage snippet.
  2. If the snippet imports a class not in the table above, search Transformers docs for that class's AutoModel* equivalent.

End-to-end flow (beginner-friendly)

Given Qwen/Qwen2.5-7B-Instruct:

sh
python3 scripts/detect.py --model Qwen/Qwen2.5-7B-Instruct --json
# {"detected": "text_generation", "loader": "transformers.AutoModelForCausalLM",
#  "inputs": ["input_ids", "attention_mask"], ...}

The agent then uses torch-xpu-run's preflight helper with the correct loader class and the correct first generate() call.

Given openai/clip-vit-base-patch32:

sh
python3 scripts/detect.py --model openai/clip-vit-base-patch32
# detected: vision_language  ->  CLIPModel + AutoProcessor + pixel_values + input_ids

The agent supplies an image alongside the prompt instead of calling model.generate(input_ids=...).

Output schema (with --json)

json
{
  "model_id": "openai/clip-vit-base-patch32",
  "detected": "vision_language",
  "loader": "transformers.CLIPModel",
  "processor": "transformers.AutoProcessor",
  "inputs": ["pixel_values", "input_ids"],
  "confidence": "architectures[0]",
  "rationale": "architectures[0]=CLIPModel; text + vision towers detected",
  "signals": {
    "name_pattern": null,
    "config_architectures": ["CLIPModel"],
    "pipeline_tag": "zero-shot-image-classification"
  }
}

Exit codes

CodeMeaning
0Detection succeeded; detected is a usable type
2unknown or incompatible — detection could not resolve a loader; read detected + rationale to distinguish
3reward_model — detection succeeded but the model is not suitable for conversational smoke tests

Codes 2 and 3 are expected outcomes, not crashes. Agents should read the detected field rather than treating any non-zero exit as a failure.

What this skill does NOT cover

  • Loading the model (see torch-xpu-run / vllm-xpu-run).
  • VRAM sizing (see model-can-it-fit).

References

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Xpu Model Type Detect AI skill do?

Before loading a Hugging Face model on Intel XPU, detect its actual type (text generation, text encoder, seq2seq, vision classification, vision-language, audio encoder, audio seq2seq, multimodal VL, diffusion, time-series, reward model, masked LM) so the agent picks the right `AutoModel` class and input kwargs. Prevents "got unexpected keyword argument 'pixel_values'" and "empty logits" errors from mis-routing. Use before `torch-xpu-run` or `vllm-xpu-run` when the user gives a model id the agent hasn't seen before, or when a smoke test fails with a wrong-input signature.

Why use Xpu Model Type Detect on TypingMind?

Because you install it once and use it with any model. Xpu Model Type Detect is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Xpu Model Type Detect in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/intel/skills/tree/main/skills/xpu-model-type-detect. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Xpu Model Type Detect?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Xpu Model Type Detect?

As many as you like. As long as a model supports skills, you can use Xpu Model Type Detect with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Xpu Model Type Detect AI skill free?

Yes. It is published on GitHub by intel under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇