Skip to content

biotune-ai-lab/conch-api

Repository files navigation

CONCH model REST API classification service

Standalone FastAPI service that serves the CONCH model.

1. setup environement variables

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

2. set up and run the service

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 sync

install pre-commit git hook scripts

uv run pre-commit install

start 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.py

run in a Docker container

build the Docker image

docker build -t conch-model .

run the Docker container service

docker compose up

manually 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published