- Text
- Image (require vision models)
- Audio (require Azure Speech to Text Service)
- Docx (not support .doc)
- Pptx (not support .ppt)
- Xlsx (support .xls)
pip install -r requirements.txt uvicorn main:app --reloadThen the service will be running on http://localhost:8000
uvicorn main:appImage:
programzmh/chatnio-blob-service
docker run -p 8000:8000 programzmh/chatnio-blob-service # with environment variables # docker run -p 8000:8000 -e AZURE_SPEECH_KEY="..." -e AZURE_SPEECH_REGION="..." programzmh/chatnio-blob-service # if you are using `local` storage type, you need to mount volume (/static) to the host # docker run -p 8000:8000 -v /path/to/static:/static programzmh/chatnio-blob-servicePOST /upload Upload a file
{ "file": "file" }Response
{ "status": true, "content": "...", "error": "" }MAX_FILE_SIZE: Max Uploaded File Size MiB (Default: No Limit)- Tips: Size limit is also depend on the server configuration (e.g. Nginx/Apache Config, Vercel Free Plan Limit 5MB Body Size)
CORS_ALLOW_ORIGINS: CORS Allow Origins (Default:*)AZURE_SPEECH_KEY: Azure Speech to Text Service Key (Required for Audio Support)AZURE_SPEECH_REGION: Azure Speech to Text Service Region (Required for Audio Support)
OCR Support is based on PaddleOCR API, please deploy the API to use OCR feature.
When OCR is enabled, the service will automatically extract text from the image and skip the original image storage solution below.
OCR_ENABLEDImage OCR Enabled (1for Enabled,0for Disabled, Default is Disabled)OCR_ENDPOINTPaddle OCR Endpoint (Deploy PaddleOCR API)- e.g.: http://example.com:8000
-
β¨ No Storage (Default)
- No Storage Required & No External Dependencies
- Base64 Encoding/Decoding
- Support Serverless Deployment Without Storage (e.g. Vercel)
-
π Local Storage
- Require Server Environment (e.g. VPS, Docker)
- Support Direct URL Access
- Payless Storage Cost
- Config:
- set env
STORAGE_TYPEtolocal(e.g.STORAGE_TYPE=local) - set env
LOCAL_STORAGE_DOMAINto your deployment domain (e.g.LOCAL_STORAGE_DOMAIN=http://blob-service.onrender.com) - if you are using Docker, you need to mount volume
/staticto the host (e.g.-v /path/to/static:/static)
- set env
-
π AWS S3
- Payment Storage Cost
- Support Direct URL Access
- China Mainland User Friendly
- Config:
- set env
STORAGE_TYPEtos3(e.g.STORAGE_TYPE=s3) - set env
S3_ACCESS_KEYto your AWS Access Key ID - set env
S3_SECRET_KEYto your AWS Secret Access Key - set env
S3_BUCKETto your AWS S3 Bucket Name - set env
S3_REGIONto your AWS S3 Region
- set env
-
π Cloudflare R2
- Free Storage Quota (10GB Storage & Zero Outbound Cost)
- Support Direct URL Access
- Config (S3 Compatible):
- set env
STORAGE_TYPEtos3(e.g.STORAGE_TYPE=s3) - set env
S3_ACCESS_KEYto your Cloudflare R2 Access Key ID - set env
S3_SECRET_KEYto your Cloudflare R2 Secret Access Key - set env
S3_BUCKETto your Cloudflare R2 Bucket Name - set env
S3_DOMAINto your Cloudflare R2 Domain Name (e.g.https://<account-id>.r2.cloudflarestorage.com) - set env
S3_DIRECT_URL_DOMAINto your Cloudflare R2 Public URL Access Domain Name (Open Public URL Access, e.g.https://pub-xxx.r2.dev)
- set env
-
π¦ Min IO
- Self Hosted
- Reliable & Flexible Storage
- Config (S3 Compatible):
- set env
STORAGE_TYPEtos3(e.g.STORAGE_TYPE=s3) - set env
S3_SIGN_VERSIONtos3v4(e.g.S3_SIGN_VERSION=s3v4) - set env
S3_ACCESS_KEYto your Min IO Access Key ID - set env
S3_SECRET_KEYto your Min IO Secret Access Key - set env
S3_BUCKETto your Min IO Bucket Name - set env
S3_DOMAINto your Min IO Domain Name (e.g.https://oss.example.com) - [Optional] If you are using CDN, you can set
S3_DIRECT_URL_DOMAINto your Min IO Public URL Access Domain Name (e.g.https://cdn-hk.example.com)
- set env
-
β€ Telegram CDN
- Free Storage (Rate Limit)
- Support Direct URL Access (China Mainland User Unfriendly)
- Config:
- set env
STORAGE_TYPEtotg(e.g.STORAGE_TYPE=tg) - set env
TG_ENDPOINTto your TG-STATE Endpoint (e.g.TG_ENDPOINT=https://tgstate.vercel.app) - [Optional] if you are using password authentication, you can set
TG_PASSWORDto your TG-STATE Password
- set env