-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: API key permission system development completed (#112)
* fix: try to fix ci * wip: add level functionality to forward key * update doc * Only cache successful responses. * forward key现在可以精确控制有权限访问的模型 * 为解决leveldb环境问题,更新dockerfile基础镜像,镜像大小将有所膨胀 * 增添test case
- Loading branch information
Showing
21 changed files
with
573 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
FROM python:3.10-alpine | ||
LABEL maintainer="kunyuan" | ||
FROM python:3.10-slim | ||
LABEL maintainer="K.Y" | ||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
ENV TZ=Asia/Shanghai | ||
RUN apk update && \ | ||
apk add tzdata --no-cache && \ | ||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ | ||
apk del tzdata && \ | ||
mkdir -p /usr/share/zoneinfo/Asia/ && \ | ||
ln -s /etc/localtime /usr/share/zoneinfo/Asia/Shanghai | ||
|
||
RUN apt update && \ | ||
apt install -y tzdata && \ | ||
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ | ||
dpkg-reconfigure -f noninteractive tzdata && \ | ||
apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY . /home/openai-forward | ||
WORKDIR /home/openai-forward | ||
RUN apk add patch g++ libstdc++ leveldb-dev linux-headers --no-cache && \ | ||
pip install -e . --no-cache-dir && \ | ||
pip install "lmdb>=1.4.1" "plyvel>=1.5.0" --no-cache-dir && \ | ||
apk del g++ gcc && rm -rf /var/cache/apk/* | ||
RUN apt-get update && \ | ||
apt-get install -y patch g++ gcc libstdc++6 libtcmalloc-minimal4 libleveldb-dev cmake make build-essential && \ | ||
pip3 install -e . --no-cache-dir && \ | ||
apt-get remove -y patch g++ gcc cmake make build-essential && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
EXPOSE 8000 | ||
ENTRYPOINT ["python", "-m", "openai_forward.__main__", "run"] | ||
ENTRYPOINT ["python3", "-m", "openai_forward.__main__", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "0.7.0" | ||
__version__ = "0.7.1" | ||
|
||
from dotenv import load_dotenv | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import os | ||
import pickle | ||
import threading | ||
import time | ||
from abc import ABC, abstractmethod | ||
|
Oops, something went wrong.