Skip to content
Back to skills

Models And Encoders

ASecurity

"Load and validate MTEB models, built-in model metadata,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
ai-agentspythonapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill models-and-encoders --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Models And Encoders?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Models And Encoders
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-models-and-encoders/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-models-and-encoders)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: models-and-encoders
description: "Load and validate MTEB models, built-in model metadata,
  SentenceTransformers/CrossEncoder/custom encoder/search protocols, prompts,
  encode kwargs, embedding cache/compression/search wrappers, and optional model
  extras."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# MTEB Models and Encoders

Use this sub-skill when the user needs to choose, load, wrap, validate, or troubleshoot a model object for MTEB. This includes built-in MTEB model metadata, fallback Hugging Face/SentenceTransformers loading, CrossEncoder rerankers, custom `EncoderProtocol`/`CrossEncoderProtocol`/`SearchProtocol` implementations, prompt routing, `encode_kwargs`, BM25 baselines, embedding caching, embedding compression, and optional provider extras.

## Route by Need

- **Load a registered or Hub model:** Use `references/model-api.md` for `mteb.get_model`, `mteb.get_model_meta`, `mteb.get_model_metas`, `revision`, `device`, `embed_dim`, `experiment_kwargs`, and optional extras.
- **Build or validate a custom model:** Use `references/custom-encoders.md` and run `scripts/validate_encoder_protocol.py` before evaluation to catch missing `encode`, `predict`, `index`, `search`, `similarity`, or constructor-shape problems.
- **Add prompts or encode options:** Use `references/model-api.md` for `model_prompts`, prompt priority, `PromptType.query`/`PromptType.document`, and passing `encode_kwargs` through `mteb.evaluate`.
- **Cache or compress embeddings:** Use `references/model-api.md` for `CachedEmbeddingWrapper`, `NumpyCache`, `FaissCache`, `CompressionWrapper`, `OutputDType`, and cache-path hygiene.
- **Use search/reranking wrappers:** Use `references/custom-encoders.md` for `SearchEncoderWrapper`, `SearchCrossEncoderWrapper`, BM25 baselines, and when a CrossEncoder requires pre-ranked documents.
- **Fix model failures:** Use `references/troubleshooting.md` for import/install extras, provider packages, private datasets/models, cache/result paths, task filters, CLI/API misuse, and protocol mismatch symptoms.

## Minimal Patterns

```python
import mteb

meta = mteb.get_model_meta("intfloat/multilingual-e5-small")
model = meta.load_model(device="cpu")
# Equivalent eager load:
model = mteb.get_model("intfloat/multilingual-e5-small", device="cpu")
```

```python
import mteb
from sentence_transformers import SentenceTransformer, CrossEncoder

dense_model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
reranker = CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")
```

```python
from mteb.models import CompressionWrapper
from mteb.models.cache_wrappers import CachedEmbeddingWrapper
from mteb.types import OutputDType

model = CachedEmbeddingWrapper(model, cache_path=".mteb-embedding-cache")
model = CompressionWrapper(model, output_dtype=OutputDType.INT8)
```

## Cross-links

- For actually evaluating a loaded model, pass model objects or `ModelMeta` into `../evaluation-workflows/`.
- For adding a new `ModelMeta` implementation to MTEB itself, use `../contributing-to-mteb/`.
- For model cards, result submission, and leaderboard expectations, use `../results-and-leaderboard/`.

Files in this skill

  • SKILL.md3.1 KB
  • references/custom-encoders.md7.1 KB
  • references/model-api.md7.8 KB
  • references/troubleshooting.md7.5 KB
  • scripts/validate_encoder_protocol.py8.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.