/tei:teifrom tei
Use when the user wants to call Hugging Face Text Embeddings Inference (TEI) to check health or model info, generate embeddings, create sparse embeddings, rerank candidate texts, tokenize input, or use the OpenAI-compatible embeddings endpoint. Trigger phrases include "embed this text", "convert to a vector", "rerank these results", "what model is my TEI server running", "tokenize this sentence", and "check TEI health".
Ships in tei. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Hugging Face Text Embeddings Inference server: embed text, rerank candidates, and tokenize input through the TEI HTTP API.
Prefer scripts/tei-api.sh for common TEI requests. It resolves TEI_URL and
optional TEI_AUTH_HEADER from the plugin-generated config first, then the
environment or legacy ~/.lab/.env, and exposes health, info, embed,
embed-batch, sparse, rerank, tokenize, and openai-embed.
Configure tei_url and optional sensitive tei_auth_header in Claude plugin
settings or Gemini extension settings. The hook writes
${XDG_CONFIG_HOME:-~/.config}/lab-tei/config.env with mode 600.
Use the TEI base URL from plugin config, the runtime environment, or legacy lab configuration:
source "${XDG_CONFIG_HOME:-$HOME/.config}/lab-tei/config.env" 2>/dev/null || true
TEI_URL=${TEI_URL:-$(grep -E '^TEI_URL=' ~/.lab/.env 2>/dev/null | cut -d= -f2-)}
test -n "$TEI_URL" || echo "TEI_URL is not configured"
TEI often runs unauthenticated on trusted networks. If the deployment is behind
auth, set tei_auth_header to the full header, for example
Authorization: Bearer <token>. Do not put real tokens in examples or committed
files.
| Intent | Request |
|---|---|
| Health | curl -sS "$TEI_URL/health" -w '\nHTTP %{http_code}\n' |
| Loaded model / runtime info | curl -sS "$TEI_URL/info" |
| Embed text | curl -sS -X POST "$TEI_URL/embed" -H 'Content-Type: application/json' -d '{"inputs":"hello world"}' |
| Embed (batch) | curl -sS -X POST "$TEI_URL/embed" -H 'Content-Type: application/json' -d '{"inputs":["a","b"]}' |
| Sparse embeddings (SPLADE) | curl -sS -X POST "$TEI_URL/embed_sparse" -H 'Content-Type: application/json' -d '{"inputs":"hello"}' |
| Rerank against a query | curl -sS -X POST "$TEI_URL/rerank" -H 'Content-Type: application/json' -d '{"query":"fruit","texts":["apple","car"]}' |
| Tokenize | curl -sS -X POST "$TEI_URL/tokenize" -H 'Content-Type: application/json' -d '{"inputs":"hello world"}' |
| OpenAI-compatible embeddings | curl -sS -X POST "$TEI_URL/v1/embeddings" -H 'Content-Type: application/json' -d '{"input":"hello","model":"tei"}' |
/embed and /rerank depend on the loaded model: an embedding model serves /embed (and /rerank returns a 424 model is not a re-ranker error), while a reranker model serves /rerank. Check /info to see which is loaded. /rerank accepts at most 100 texts per call - split larger batches across requests.
Full API reference: https://huggingface.github.io/text-embeddings-inference/
Verify the resolved URL before making model calls:
curl -sS "$TEI_URL/health" -w '\nHTTP %{http_code}\n'
qdrant skill.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dinglebear-ai/dendrite --plugin tei