Standalone FastAPI service that serves the CONCH model.
refer to examples/ - you will need to create .env (and .env.docker if you are using Docker) and place them in the root of the project folder.
tip: copy-paste the existing example files, remove the .example at then end, and add the correct variables per your configuration
set up a dedicated virtual environment to run the service
# (install uv)
# curl -LsSf https://astral.sh/uv/install.sh | sh
# https://docs.astral.sh/uv/getting-started/installation/
uv python install 3.11
uv syncinstall pre-commit git hook scripts
uv run pre-commit installstart the service
# development
uv run fastapi dev --host 127.0.0.1 --port 54001 service.py
# production
uv run uvicorn service:app --host 127.0.0.1 --port 54001
# OR
uv run fastapi run --host 127.0.0.1 --port 54001 service.pybuild the Docker image
docker build -t conch-model .run the Docker container service
docker compose upmanually request classification for an image
# e.g. local
IMAGE_PATH="minio/{bucket_name}/{image_filename}"
# e.g. docker
IMAGE_PATH="local/{image_filename}"
# curl command once IMAGE_PATH has been set
curl -X GET "http://127.0.0.1:54001/process/${IMAGE_PATH}" -H "accept: application/json"
service documentation: http://127.0.0.1:54001/docs
NOTE: The service is designed to run locally and currently doesn't incorporate authentication or other security features.