A Docker image providing an OpenAI-compatible HTTP API (/v1/embeddings) for multimodal text and image embeddings powered by Google AI Edge's LiteRT-LM and EmbeddingGemma 2 740M.
The model is pre-downloaded and registered during the Docker build, enabling completely offline and network-isolated execution.
- Omnimodal Embedding Backbone: Powered by
EmbeddingGemma 2 740Mwith unified 768-dimensional vector space across text and image. - OpenAI-Compatible API: Implements standard
/v1/modelsand/v1/embeddingsendpoints. - Multimodal Inputs: Supports text prompts and image base64 data URIs (
data:image/jpeg;base64,...). - Offline Capable: Model package is pre-baked into the image; runs with
--network none. - Matryoshka Representation Learning (MRL): Supports custom dimension truncation (e.g.
dimensions: 256,512,768). - Lightweight & Fast: Built with
uvin a multi-stage Docker build, producing a minimal Python 3.14 Debian slim runtime.
docker run -d \
--name litert-embedding \
-p 9379:9379 \
shumaione/embedding-server:latestAliyun ACR Mirror:
docker run -d \
--name litert-embedding \
-p 9379:9379 \
crpi-000nkafzu6xvpwsc.cn-hongkong.personal.cr.aliyuncs.com/shumai-one/embedding-server:latestYou can also build the Docker image locally from source:
docker build -t shumaione/embedding-server:latest .(Optional build args: MODEL_REPO, MODEL_FILE, MODEL_ID to use other variants such as embeddinggemma-2-text-vision-440m-litert-lm).
The server runs by default on port 9379.
curl http://localhost:9379/v1/modelsOutput:
{
"object": "list",
"data": [
{
"id": "embeddinggemma-2-740m",
"object": "model",
"owned_by": "litert-lm"
},
{
"id": "embeddinggemma-2",
"object": "model",
"owned_by": "litert-lm"
}
]
}curl -X POST http://localhost:9379/v1/embeddings \
-H "Content-Type: application/json" \
-d '{
"model": "embeddinggemma-2-740m",
"input": "task: search result | text: LiteRT-LM enables on-device LLM inference."
}'Pass images formatted as standard OpenAI multimodal image content parts:
curl -X POST http://localhost:9379/v1/embeddings \
-H "Content-Type: application/json" \
-d '{
"model": "embeddinggemma-2-740m",
"input": [
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wgALCAABAAEBAREA/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQABPxA="
}
}
]
}'Run the included test suite against the running container:
python3 test_client.pyThis project is licensed under the MIT License.