Configuring Marqo
Marqo is configured through environment variables passed to the Marqo container when it is run.
Configuring usage limits
Limits can be set to protect the resources of the machine Marqo is running on.
Configuration name | Default | Description |
---|---|---|
MARQO_MAX_INDEX_FIELDS |
n/a | Maximum number of fields allowed per index |
MARQO_MAX_DOC_BYTES |
100000 | Maximum document size allowed to be indexed |
MARQO_MAX_RETRIEVABLE_DOCS |
n/a | Maximum number of documents allowed to be returned in a single request |
MARQO_MAX_NUMBER_OF_REPLICAS |
1 | Maximum number of replicas allowed when creating an index |
Example
docker run --name marqo --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway \
-e "MARQO_MAX_INDEX_FIELDS=400" \
-e "MARQO_MAX_DOC_BYTES=200000" \
-e "MARQO_MAX_RETRIEVABLE_DOCS=600" \
-e "MARQO_MAX_NUMBER_OF_REPLICAS=2" marqoai/marqo:latest
-
The max number of fields per index is capped at 400
-
The max size of an indexed document is 0.2mb
-
The max number of documents allowed to be returned in a single request is 600
-
The max number of replicas allowed when creating an index is 2.
Configuring preloaded models
-
Variable:
MARQO_MODELS_TO_PRELOAD
-
Default value:
'["hf/all_datasets_v4_MiniLM-L6", "ViT-L/14"]'
-
Expected value: A JSON-encoded array of strings or objects.
This is a list of models to load and pre-warm as Marqo starts. This prevents a delay during initial search and index commands in actual Marqo usage.
Models in string form must be names of models within the model registry. You can find these models here
Models in object form must have model
and model_properties
keys.
Model Object Example (OPEN CLIP model)
'{
"model": "my-open-clip-1",
"model_properties": {
"name": "ViT-B-32-quickgelu",
"dimensions": 512,
"url": "https://github.com/mlfoundations/open_clip/releases/download/v0.2-weights/vit_b_32-quickgelu-laion400m_avg-8a00ab3c.pt",
"type": "open_clip"
}
}'
Model Object Example (CLIP model)
'{
"model": "generic-clip-test-model-2",
"model_properties": {
"name": "ViT-B/32",
"dimensions": 512,
"type": "clip",
"url": "https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.pt"
}
}'
Marqo Run Example (containing both string and object)
export MY_MODEL_LIST='[
"sentence-transformers/stsb-xlm-r-multilingual",
"hf/all_datasets_v4_MiniLM-L6",
{
"model": "generic-clip-test-model-2",
"model_properties": {
"name": "ViT-B/32",
"dimensions": 512,
"type": "clip",
"url": "https://openaipublic.azureedge.net/clip/models/40d365715913c9da98579312b702a82c18be219cc2a73407c4526f58eba950af/ViT-B-32.pt"
}
}
]'
docker run --name marqo --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway \
-e MARQO_MODELS_TO_PRELOAD="$MY_MODEL_LIST" \
marqoai/marqo:latest
Configuring log level
-
Variable:
MARQO_LOG_LEVEL
-
Default value:
'info'
-
Expected value: a
str
from one of'error'
,'warning'
,'info'
,'debug'
.
This environment variable will change the log level of timing logger and uvicorn logger. A higher log level
(e.g., 'error'
) will reduce the amount of logs in Marqo, while a lower log level ('debug'
) will record more detailed
information in the logs. The default level is 'info'
.
Example
docker run --name marqo --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway \
-e MARQO_LOG_LEVEL='warning' \
marqoai/marqo:latest
Configuring throttling
Configuration name | Default | Description |
---|---|---|
MARQO_ENABLE_THROTTLING |
"TRUE" |
Adds throttling if "TRUE" . Must be a str : Either "TRUE" or "FALSE" . |
MARQO_MAX_CONCURRENT_INDEX |
8 | Maximum allowed concurrent indexing threads |
MARQO_MAX_CONCURRENT_SEARCH |
8 | Maximum allowed concurrent search threads |
These environment variables set Marqo's allowed concurrency across index and search. If these limits are reached, then Marqo will return 429
on subsequent requests. These should be set with respect to available resources of the machine Marqo will be running on.
Example
docker run --name marqo --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway \
-e MARQO_ENABLE_THROTTLING='TRUE' \
-e MARQO_MAX_CONCURRENT_SEARCH='10' \
marqoai/marqo:latest
Other configurations
Configuration name | Default | Description |
---|---|---|
MARQO_EF_CONSTRUCTION_MAXIMUM_VALUE |
4096 | The maximum ef_construction value of Marqo indexes created by this Marqo instance. |
MARQO_MAX_SEARCHABLE_TENSOR_ATTRIBUTES |
null | The maximum allowed number of tensor fields to be searched in a single tensor search query |