Skip to content

Configuration

All configuration is passed as command-line arguments. Every argument also has a corresponding environment variable.

CLI arguments

ArgumentEnvironment variableDefaultDescription
--hostHOST0.0.0.0Network interface to bind to
--portPORT8080Port to listen on
--modelMODELminishlab/potion-multilingual-128MHugging Face model id or local path; repeatable
--default-modelDEFAULT_MODELfirst --modelModel to use when a request does not specify one
--model-ownerMODEL_OWNERminishlabModel publisher or owner shown in /v1/models responses
--api-keyAPI_KEYnoneEnables Bearer token authentication
--max-batch-sizeMAX_BATCH_SIZE256Maximum inputs per request
--max-input-lengthMAX_INPUT_LENGTH512Maximum tokens per input
--log-levelLOG_LEVELinfoLog level (e.g. trace, debug, info, warn, error)
--request-timeout-secondsREQUEST_TIMEOUT_SECONDS30Per-request timeout

Example: local development

bash
cargo run --release -- \
  --model minishlab/potion-multilingual-128M \
  --port 8080 \
  --log-level debug

Example: with API key

bash
cargo run --release -- \
  --model minishlab/potion-multilingual-128M \
  --api-key my-secret-key \
  --max-batch-size 128 \
  --max-input-length 256

Example: multiple models

bash
cargo run --release -- \
  --model minishlab/potion-multilingual-128M \
  --model minishlab/potion-code-16M-v2 \
  --default-model minishlab/potion-multilingual-128M \
  --port 8080

The MODEL environment variable accepts a comma-separated list:

bash
MODEL=minishlab/potion-multilingual-128M,minishlab/potion-code-16M-v2 \
DEFAULT_MODEL=minishlab/potion-multilingual-128M \
cargo run --release

Docker / Kubernetes

When running the container or Helm chart, pass values as environment variables:

bash
docker run -p 8080:8080 \
  -e MODEL=minishlab/potion-multilingual-128M \
  -e API_KEY=my-secret-key \
  -e MAX_BATCH_SIZE=128 \
  model2vec-serve:latest

In Helm, use --set:

bash
helm install model2vec-serve ./helm/model2vec-serve \
  --set models={minishlab/potion-multilingual-128M,minishlab/potion-code-16M-v2} \
  --set defaultModel=minishlab/potion-multilingual-128M \
  --set apiKey=my-secret-key \
  --set args[0]=--max-batch-size \
  --set args[1]=128

See Helm for the full list of chart values.

Powered by model2vec