CoolFace
Apppublic

chmielvu/fastembed-snowflake

sourceHugging Faceupdated 13d agoView on Hugging Face
0likes
App README

FastEmbed Embedding API (Docker SDK, cpu-basic)

Mirror of the Contabo VPS deployment at /srv/stacks/fastembed-snowflake/app.py, running on HF Spaces cpu-basic (2 vCPU / 16 GB). Default model is snowflake/snowflake-arctic-embed-s (FastEmbed ONNX, 384-dim) — same as the live VPS systemd unit. Override via the FASTEMBED_MODEL Space env var if you need a different FastEmbed ONNX model.

Endpoints

MethodPathPurpose
GET/Endpoint catalogue
GET/healthLiveness probe (200 ready / 503 not_ready)
GET/infoModel + runtime config
POST/embedHF-friendly {"texts": "..." or [...]}
POST/embeddingsNative, {"texts": [...]}
POST/v1/embeddingsOpenAI-compatible, {"input": "..."}

Configured env vars (Space)

VarDefaultNotes
FASTEMBED_MODELsnowflake/snowflake-arctic-embed-sAny FastEmbed-supported model id
FASTEMBED_THREADS2ONNX intra-op threads
FASTEMBED_MAX_BATCH256Texts per request
FASTEMBED_MAX_CHARS8192Per-text cap
FASTEMBED_MAX_BODY2097152 (2 MiB)Hard body cap

Quick test

bash
# Public Space — no token needed for embed/info
curl -s https://chmielvu-fastembed-snowflake.hf.space/info | jq

curl -s -X POST https://chmielvu-fastembed-snowflake.hf.space/embed \
  -H 'content-type: application/json' \
  -d '{"texts": ["hello world", "goodnight moon"]}' | jq '.dimension, .embeddings | length'

# OpenAI-compatible
curl -s -X POST https://chmielvu-fastembed-snowflake.hf.space/v1/embeddings \
  -H 'content-type: application/json' \
  -d '{"input": "goodnight moon"}' | jq '.data[0].embedding | length'

Persistent cache

FASTEMBED_CACHE_PATH=/data — mount a Space volume (hf spaces volumes set chmielvu/fastembed-snowflake -v hf://buckets/<owner>/<bucket>:/data) to keep the ONNX weights warm across restarts. Cold start without the volume is ~25 s on cpu-basic.

Local run

bash
docker build -t fastembed-snowflake .
docker run --rm -p 7860:7860 fastembed-snowflake
curl -s http://localhost:7860/health

Source

Authored locally at C:/Users/Jan/Documents/GitHub/1Agents1/.CLI/cloud_services/HF/fastembed-snowflake/ and pushed to this Space. The original Contabo-VPS source lives at /srv/stacks/fastembed-snowflake/app.py — keep them in sync; the HF copy is a verbatim port of the VPS code with three small additions called out at the top of app.py.