uni-api / README.md
yym68686's picture
update README
53eb9f9
|
raw
history blame
1.08 kB

uni-api

curl -X POST http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-KjjI60Yf0JFcsvgRmXqFwgGmWUd9GZnmi3KlvowmRWpWpQRo" \
-d '{"model": "gpt-4o","messages": [{"role": "user", "content": "Hello"}],"stream": true}'

Docker Local Deployment

Start the container

docker run -p 8001:8000 --name uni-api -dit \
    -v ./api.yaml:/home/api.yaml \
    -e USE_ROUND_ROBIN=True \
    yym68686/uni-api:latest

Or if you want to use Docker Compose, here is a docker-compose.yml example:

version: "3.5"
services:
  uni-api:
    container_name: uni-api
    image: yym68686/uni-api:latest
    environment:
      - USE_ROUND_ROBIN=True
    ports:
      - 8001:8000
    volumes:
      - ./api.yaml:/home/api.yaml

Run Docker Compose container in the background

docker-compose up -d

Docker build

docker build --no-cache -t uni-api:latest -f Dockerfile --platform linux/amd64 .
docker tag uni-api:latest yym68686/uni-api:latest
docker push yym68686/uni-api:latest