OpenAI-compatible local embedding service using BGE-small-zh-v1.5 model.
`�ash
pip install -r requirements.txt
python download_model.py
python server.py `
Server runs at http://127.0.0.1:9092
�ash curl http://localhost:9092/health
�ash curl http://localhost:9092/v1/embeddings -H "Content-Type: application/json" -d '{"input": "hello world", "model": "bge-small-zh-v1.5"}'
`python import requests
response = requests.post( "http://127.0.0.1:9092/v1/embeddings", json={"input": "hello", "model": "bge-small-zh-v1.5"} )
vector = response.json()["data"][0]["embedding"] print(f"Dimensions: {len(vector)}") # 512 `
- Model: BAAI/bge-small-zh-v1.5
- Dimensions: 512
- Size: ~90 MB
- Optimized for Chinese text
- server.py - FastAPI server
- download_model.py - Model downloader with Chinese mirror
equirements.txt - Python dependencies
- Dockerfile - Docker image
- wheels/ - Offline Python packages (~200MB)
MIT License