This commit is contained in:
Zheng Kai
2023-08-09 18:47:52 +08:00
parent 71ec1811e1
commit 866b2f569c
4 changed files with 23 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
SHELL:=/bin/bash SHELL:=/bin/bash
TARGET_HOST:=lamia TARGET_HOST:=lamia
RACHEL_HOST:=rachel
include ../../server/build/env.sh include ../../server/build/env.sh
@@ -26,6 +27,14 @@ install: build
ssh $(TARGET_HOST) "chmod +x /tmp/install.sh && /tmp/install.sh && rm /tmp/install.sh" ssh $(TARGET_HOST) "chmod +x /tmp/install.sh && /tmp/install.sh && rm /tmp/install.sh"
ssh $(TARGET_HOST) "rm /tmp/env.sh" ssh $(TARGET_HOST) "rm /tmp/env.sh"
rachel: build
sudo docker save orca > docker-orca.tar
scp docker-orca.tar $(RACHEL_HOST):/tmp
scp install.sh $(RACHEL_HOST):/tmp
scp ../../server/build/env.sh $(RACHEL_HOST):/tmp
ssh $(RACHEL_HOST) "chmod +x /tmp/install.sh && /tmp/install.sh && rm /tmp/install.sh"
ssh $(RACHEL_HOST) "rm /tmp/env.sh"
nginx: nginx:
scp ../nginx/prod.conf lamia:/etc/nginx/vhost.d/600-orca scp ../nginx/prod.conf lamia:/etc/nginx/vhost.d/600-orca

View File

@@ -4,7 +4,7 @@ BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl -v "${BASE}/chat/completions" \ curl -v "${BASE}/chat/completions" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY} no-cache" \ -H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{ -d '{
"model": "gpt-3.5-turbo", "model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}] "messages": [{"role": "user", "content": "Hello!"}]

View File

@@ -6,6 +6,7 @@ export OPENAI_API_KEY
BASE="https://api.openai.com/v1" BASE="https://api.openai.com/v1"
curl -v "${BASE}/chat/completions" \ curl -v "${BASE}/chat/completions" \
-w "Total time: %{time_total} seconds\n" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \ -H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{ -d '{

6
misc/test/models-list.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
OPENAI_API_KEY="sk-rhjeVT1fkcuarBKnQR6ST$(cat ~/.config/openai)"
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer ${OPENAI_API_KEY}"