Embeddings server needed for the knowledge base search with the AI-assistant of Baserow.
2.1K
A lightweight, self-contained text embedding microservice for Baserow's AI Assistant features. This service provides fast sentence embeddings using an ONNX-optimized model.
This service converts text into dense vector representations (embeddings) that can be used for:
Model: sentence-transformers/all-MiniLM-L6-v2
The service uses a multi-stage Docker build:
docker run -p 8080:80 baserow/embeddings:1.0.0
docker build -t baserow/embeddings:1.0.0
docker scout cves baserow/embeddings:1.0.0
docker tag baserow/embeddings:1.0.0 baserow/embeddings:latest
docker push baserow/embeddings:1.0.0
docker push baserow/embeddings:latest
POST http://localhost:8080/embedGenerate embeddings for one or more texts.
Request:
{
"texts": "Your text here"
}
or for batching:
{
"texts": ["First text", "Second text", "Third text"]
}
Response:
{
"embeddings": [[0.123, -0.456, ...], ...]
}
Example:
curl -X POST http://localhost:8080/embed \
-H "Content-Type: application/json" \
-d '{"texts": "What is the capital of France?"}'
GET /healthHealth check endpoint.
Response:
{
"status": "healthy"
}
docker build -t baserow-embeddings .
docker run -p 8080:80 baserow-embeddings
The service will be available at http://localhost:8080.
# Install dependencies
pip install optimum[onnxruntime]==1.27.0 transformers==4.53.0 starlette==0.48.0 uvicorn==0.37.0
# Download model
python -c "
from optimum.onnxruntime import ORTModelForFeatureExtraction
from transformers import AutoTokenizer
model = ORTModelForFeatureExtraction.from_pretrained('sentence-transformers/all-MiniLM-L6-v2', export=True)
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
model.save_pretrained('./model')
tokenizer.save_pretrained('./model')
"
# Run locally
uvicorn app:app --host 0.0.0.0 --port 8080
import requests
response = requests.post('http://localhost:8080/embed', json={
'text': ['Hello world', 'How are you?']
})
embeddings = response.json()['embeddings']
print(f"Generated {len(embeddings)} embeddings of dimension {len(embeddings[0])}")
This service is used by Baserow's AI Assistant to:
The embeddings enable the assistant to understand the semantic meaning of user queries and match them with the most relevant database records, even when there's no exact keyword match.
This service is part of the Baserow project. See the main repository for license information.
Content type
Image
Digest
sha256:3357549fd…
Size
225 MB
Last updated
11 months ago
docker pull baserow/embeddings