Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 94e0f93

Browse files
committed
refactor: rename
1 parent e8e1100 commit 94e0f93

File tree

22 files changed

+274
-275
lines changed

22 files changed

+274
-275
lines changed

.github/scripts/e2e-test-llama-linux-and-mac.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash
22

33
## Example run command
4-
# ./linux-and-mac.sh './jan/plugins/@janhq/inference-plugin/dist/nitro/nitro_mac_arm64' https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF/resolve/main/tinyllama-1.1b-chat-v0.3.Q2_K.gguf
4+
# ./linux-and-mac.sh './jan/plugins/@janhq/inference-plugin/dist/cortex-cpp/nitro_mac_arm64' https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF/resolve/main/tinyllama-1.1b-chat-v0.3.Q2_K.gguf
55

66
# Check for required arguments
77
if [[ $# -ne 3 ]]; then
88
echo "Usage: $0 <path_to_binary> <url_to_download_llm> <url_to_download_embedding>"
99
exit 1
1010
fi
1111

12-
rm /tmp/load-llm-model-res.log /tmp/completion-res.log /tmp/unload-model-res.log /tmp/load-embedding-model-res.log /tmp/embedding-res.log /tmp/nitro.log
12+
rm /tmp/load-llm-model-res.log /tmp/completion-res.log /tmp/unload-model-res.log /tmp/load-embedding-model-res.log /tmp/embedding-res.log /tmp/cortex-cpp.log
1313

1414
BINARY_PATH=$1
1515
DOWNLOAD_LLM_URL=$2
@@ -22,14 +22,14 @@ range=$((max - min + 1))
2222
PORT=$((RANDOM % range + min))
2323

2424
# Start the binary file
25-
"$BINARY_PATH" 1 127.0.0.1 $PORT >/tmp/nitro.log &
25+
"$BINARY_PATH" 1 127.0.0.1 $PORT >/tmp/cortex-cpp.log &
2626

2727
# Get the process id of the binary file
2828
pid=$!
2929

3030
if ! ps -p $pid >/dev/null; then
31-
echo "nitro failed to start. Logs:"
32-
cat /tmp/nitro.log
31+
echo "cortex-cpp failed to start. Logs:"
32+
cat /tmp/cortex-cpp.log
3333
exit 1
3434
fi
3535

@@ -47,7 +47,7 @@ if [[ ! -f "/tmp/test-embedding" ]]; then
4747
fi
4848

4949
# Run the curl commands
50-
response1=$(curl --connect-timeout 60 -o /tmp/load-llm-model-res.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/loadModel" \
50+
response1=$(curl --connect-timeout 60 -o /tmp/load-llm-model-res.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/server/loadModel" \
5151
--header 'Content-Type: application/json' \
5252
--data '{
5353
"llama_model_path": "/tmp/testllm",
@@ -57,8 +57,8 @@ response1=$(curl --connect-timeout 60 -o /tmp/load-llm-model-res.log -s -w "%{ht
5757
}')
5858

5959
if ! ps -p $pid >/dev/null; then
60-
echo "nitro failed to load model. Logs:"
61-
cat /tmp/nitro.log
60+
echo "cortex-cpp failed to load model. Logs:"
61+
cat /tmp/cortex-cpp.log
6262
exit 1
6363
fi
6464

@@ -83,14 +83,14 @@ response2=$(
8383
)
8484

8585
# unload model
86-
response3=$(curl --connect-timeout 60 -o /tmp/unload-model-res.log --request GET -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/unloadModel" \
86+
response3=$(curl --connect-timeout 60 -o /tmp/unload-model-res.log --request GET -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/server/unloadModel" \
8787
--header 'Content-Type: application/json' \
8888
--data '{
8989
"llama_model_path": "/tmp/testllm"
9090
}')
9191

9292
# load embedding model
93-
response4=$(curl --connect-timeout 60 -o /tmp/load-embedding-model-res.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/loadModel" \
93+
response4=$(curl --connect-timeout 60 -o /tmp/load-embedding-model-res.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/server/loadModel" \
9494
--header 'Content-Type: application/json' \
9595
--data '{
9696
"llama_model_path": "/tmp/test-embedding",
@@ -145,9 +145,9 @@ if [[ "$response5" -ne 200 ]]; then
145145
fi
146146

147147
if [[ "$error_occurred" -eq 1 ]]; then
148-
echo "Nitro test run failed!!!!!!!!!!!!!!!!!!!!!!"
149-
echo "Nitro Error Logs:"
150-
cat /tmp/nitro.log
148+
echo "cortex-cpp test run failed!!!!!!!!!!!!!!!!!!!!!!"
149+
echo "cortex-cpp Error Logs:"
150+
cat /tmp/cortex-cpp.log
151151
kill $pid
152152
exit 1
153153
fi
@@ -172,7 +172,7 @@ echo "----------------------"
172172
echo "Log run test:"
173173
cat /tmp/embedding-res.log
174174

175-
echo "Nitro test run successfully!"
175+
echo "cortex-cpp test run successfully!"
176176

177177
# Kill the server process
178178
kill $pid

.github/scripts/e2e-test-llama-windows.bat

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@ del %TEMP%\response2.log 2>nul
2323
del %TEMP%\response3.log 2>nul
2424
del %TEMP%\response4.log 2>nul
2525
del %TEMP%\response5.log 2>nul
26-
del %TEMP%\nitro.log 2>nul
26+
del %TEMP%\cortex-cpp.log 2>nul
2727

2828
set /a min=9999
2929
set /a max=11000
3030
set /a range=max-min+1
3131
set /a PORT=%min% + %RANDOM% %% %range%
3232

3333
rem Start the binary file
34-
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" %PORT% > %TEMP%\nitro.log 2>&1
34+
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" %PORT% > %TEMP%\cortex-cpp.log 2>&1
3535

3636
ping -n 6 127.0.0.1 %PORT% > nul
3737

38-
rem Capture the PID of the started process with "nitro" in its name
38+
rem Capture the PID of the started process with "cortex-cpp" in its name
3939
for /f "tokens=2" %%a in ('tasklist /fi "imagename eq %BINARY_NAME%" /fo list ^| findstr /B "PID:"') do (
4040
set "pid=%%a"
4141
)
4242

4343
echo pid=%pid%
4444

4545
if not defined pid (
46-
echo nitro failed to start. Logs:
47-
type %TEMP%\nitro.log
46+
echo cortex-cpp failed to start. Logs:
47+
type %TEMP%\cortex-cpp.log
4848
exit /b 1
4949
)
5050

@@ -76,15 +76,15 @@ echo curl_data4=%curl_data4%
7676
echo curl_data5=%curl_data5%
7777

7878
rem Run the curl commands and capture the status code
79-
curl.exe --connect-timeout 60 -o "%TEMP%\response1.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/loadModel" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1.log 2>&1
79+
curl.exe --connect-timeout 60 -o "%TEMP%\response1.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/server/loadModel" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1.log 2>&1
8080

81-
curl.exe --connect-timeout 60 -o "%TEMP%\response2.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/chat_completion" ^
81+
curl.exe --connect-timeout 60 -o "%TEMP%\response2.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/server/chat_completion" ^
8282
--header "Content-Type: application/json" ^
8383
--data "%curl_data2%" > %TEMP%\response2.log 2>&1
8484

85-
curl.exe --connect-timeout 60 -o "%TEMP%\response3.log" --request GET -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/unloadModel" --header "Content-Type: application/json" --data "%curl_data3%" > %TEMP%\response3.log 2>&1
85+
curl.exe --connect-timeout 60 -o "%TEMP%\response3.log" --request GET -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/server/unloadModel" --header "Content-Type: application/json" --data "%curl_data3%" > %TEMP%\response3.log 2>&1
8686

87-
curl.exe --connect-timeout 60 -o "%TEMP%\response4.log" --request POST -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/loadModel" --header "Content-Type: application/json" --data "%curl_data4%" > %TEMP%\response4.log 2>&1
87+
curl.exe --connect-timeout 60 -o "%TEMP%\response4.log" --request POST -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/server/loadModel" --header "Content-Type: application/json" --data "%curl_data4%" > %TEMP%\response4.log 2>&1
8888

8989
curl.exe --connect-timeout 60 -o "%TEMP%\response5.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/v1/embeddings" ^
9090
--header "Content-Type: application/json" ^
@@ -130,9 +130,9 @@ if "%response5%" neq "200" (
130130
)
131131

132132
if "%error_occurred%"=="1" (
133-
echo Nitro test run failed!!!!!!!!!!!!!!!!!!!!!!
134-
echo Nitro Error Logs:
135-
type %TEMP%\nitro.log
133+
echo cortex-cpp test run failed!!!!!!!!!!!!!!!!!!!!!!
134+
echo cortex-cpp Error Logs:
135+
type %TEMP%\cortex-cpp.log
136136
taskkill /f /pid %pid%
137137
exit /b 1
138138
)
@@ -158,8 +158,8 @@ echo ----------------------
158158
echo Log run embedding test:
159159
type %TEMP%\response5.log
160160

161-
echo Nitro test run successfully!
161+
echo cortex-cpp test run successfully!
162162

163163
rem Kill the server process
164164
@REM taskkill /f /pid %pid%
165-
taskkill /f /im nitro.exe 2>nul || exit /B 0
165+
taskkill /f /im cortex-cpp.exe 2>nul || exit /B 0

0 commit comments

Comments
 (0)