Some APIs around AI models.
- CPU only docker setup
- Expects preloaded models, no (annoying) auto-downloads
- Stats about token usage (partially/WIP)
- Automatic OpenAPI generation
- Text / Sentences
- Image
- Code
by Stanza
- Locale Identification
- Sentence Segmentation
- Token Classification (NER, POS, MWT)
- Sequence Classification (Sentiment)
- Lemmatization
- Semantic Search
- WIP Sentence Clustering
Clone this repository or add the service to your docker-compose.yml:
services:
baistro:
image: ghcr.io/elbakerino/baistro:0.4.0
stop_signal: SIGINT
environment:
PORT: 8702
GUN_W: 1
volumes:
# folder for model files
- ./model-assets:/app/model-assets
ports:
- "8702:8702"Startup server:
docker compose up- Service Home: localhost:8702
- OpenAPI Docs: localhost:8702/docs
- OpenAPI File: localhost:8702/openapi.json
Run CLI in docker container:
# build container before using cli (if never `up`ed before)
docker compose build baistro
# open shell in container:
docker compose run --rm baistro bash
# run cli help:
poetry run cli
# download models:
poetry run cli download
# download model `stanza-multilingual` directly:
poetry run cli download stanza-multilingual
# list models:
poetry run cli models
# generate openapi spec file:
poetry run flask --app baistro.server:app spec -f yamlConfigure the vector models via env variables for each specialization:
MODEL__VECTOR_TEXT=T-Systems-onsite/cross-en-de-roberta-sentence-transformer
MODEL__VECTOR_CODE=microsoft/unixcoder-base
MODEL__VECTOR_IMAGE=sentence-transformers/clip-ViT-B-32-multilingual-v1
- for models on huggingface: use its name then run e.g.
poetry run cli download vector-textto download the new configured model - for custom model: mount the model folder as
/app/model-assets/<custom-model>, with custom-model being the env-var value
Manage dependencies with poetry v2:
# first update lock file if .toml was changed
poetry lock --regenerate
# then sync and install
poetry sync
poetry install
# poetry lock --regenerate && poetry sync && poetry installThis project is distributed as free software under the MIT License, see License.
© 2025 Michael Becker https://i-am-digital.eu