Skip to content

Configurations

NekoImageGallery uses a flexible configuration system that allows you to customize its behavior through environment variables or a .env file. The default configuration is stored in config/default.env. It is recommended to create a config/local.env file to override the default settings.

Here are the available configuration options:

Vector Database Configuration

KeyDescriptionDefault
APP_QDRANT__MODEMode for the vector database. Options: "server", "local", "memory".server
APP_QDRANT__HOSTHostname or IP address of the Qdrant server.localhost
APP_QDRANT__PORTPort number for the Qdrant HTTP server.6333
APP_QDRANT__GRPC_PORTPort number for the Qdrant gRPC server.6334
APP_QDRANT__PREFER_GRPCSet to True to use gRPC for Qdrant connection.True
APP_QDRANT__API_KEYAPI key for Qdrant server.
APP_QDRANT__COLLCollection name to use in Qdrant.NekoImg
APP_QDRANT__LOCAL_PATHPath to the file where vectors will be stored in local mode../images_metadata

Server Configuration

KeyDescriptionDefault
APP_DEVICEDevice for PyTorch inference. "auto" for automatic detection.auto
APP_CORS_ORIGINSList of allowed origins for CORS.["*"]
APP_WITH_FRONTENDEnable built-in frontend. All APIs will be under /api.False

Models Configuration

KeyDescriptionDefault
APP_MODEL__CLIPModel for CLIP embeddings (Vision Search).openai/clip-vit-large-patch14
APP_MODEL__BERTModel for BERT embeddings (OCR Search).bert-base-chinese
APP_MODEL__EASYPADDLEOCRModel for easypaddleocr inference (OCR indexing).

OCR Search Configuration

KeyDescriptionDefault
APP_OCR_SEARCH__ENABLEEnable OCR search functionality.True
APP_OCR_SEARCH__OCR_MODULEOCR module to use for text extraction.easypaddleocr
APP_OCR_SEARCH__OCR_MIN_CONFIDENCEMinimum confidence for OCR results.1e-2
APP_OCR_SEARCH__OCR_LANGUAGEList of languages for OCR.["ch_sim", "en"]

Admin API Configuration

KeyDescriptionDefault
APP_ADMIN_API_ENABLEEnable admin API.False
APP_ADMIN_TOKENToken to access admin API.your-super-secret-admin-token
APP_ADMIN_INDEX_QUEUE_MAX_LENGTHMax length of the upload queue for admin API.200

Access Protection Configuration

KeyDescriptionDefault
APP_ACCESS_PROTECTEDEnable access protection using tokens.False
APP_ACCESS_TOKENToken to access the API.your-super-secret-access-token

Storage Settings

KeyDescriptionDefault
APP_STORAGE__METHODMethod for storing files. Options: "local", "s3", "disabled".local
APP_STORAGE__LOCAL__PATHPath where files will be stored locally../static
APP_STORAGE__S3__BUCKETName of the S3 bucket.
APP_STORAGE__S3__PATHPath where files will be stored in the S3 bucket../static
APP_STORAGE__S3__REGIONRegion where the S3 bucket is located.
APP_STORAGE__S3__ENDPOINT_URLEndpoint URL for the S3 service.
APP_STORAGE__S3__ACCESS_KEY_IDAccess key ID for S3.
APP_STORAGE__S3__SECRET_ACCESS_KEYSecret access key for S3.
APP_STORAGE__S3__SESSION_TOKENSession token for S3 (optional).
APP_STORAGE__S3__USER_ENDPOINT_URLOptional Endpoint URL for final presentation to the user.