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

Commit 7f7fd03

Browse files
committed
Merge branch 'main' of https://github.com/janhq/nitro
2 parents edc4447 + bc7d498 commit 7f7fd03

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ if(LLAMA_CUBLAS)
3333
endif()
3434
endif()
3535

36+
if (LLAMA_CUBLAS)
37+
cmake_minimum_required(VERSION 3.17)
38+
39+
find_package(CUDAToolkit)
40+
if (CUDAToolkit_FOUND)
41+
message(STATUS "cuBLAS found")
42+
add_compile_definitions(GGML_USE_CUBLAS)
43+
endif()
44+
endif()
45+
3646
add_subdirectory(llama.cpp)
3747
add_executable(${PROJECT_NAME} main.cc)
3848

README_temp.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,28 @@ This will create a build_deps folder, just ignore it
1212

1313
### Step 2:
1414

15-
Build the app from source
16-
17-
```zsh
18-
mkdir build && cd build
19-
cmake ..
20-
21-
# MacOS
22-
make -j $(sysctl -n hw.physicalcpu)
23-
# Linux
24-
make -j $(%NUMBER_OF_PROCESSORS%)
25-
```
15+
Generate build file
16+
- On MacOS with Apple silicon:
17+
18+
```zsh
19+
mkdir build && cd build
20+
cmake ..
21+
```
22+
23+
- On MacOS with Intel processors:
24+
```zsh
25+
mkdir build && cd build
26+
cmake -DLLAMA_METAL=OFF ..
27+
```
28+
29+
Build the app
30+
- On MacOS and Linux
31+
```
32+
# MacOS
33+
make -j $(sysctl -n hw.physicalcpu)
34+
# Linux
35+
make -j $(%NUMBER_OF_PROCESSORS%)
36+
```
2637

2738
### Step 3:
2839

controllers/llamaCPP.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <chrono>
55
#include <cstring>
66
#include <thread>
7+
#include <regex>
8+
79
std::string create_return_json(const std::string &id, const std::string &model,
810
const std::string &content,
911
Json::Value finish_reason = Json::Value()) {

controllers/llamaCPP.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "llama.h"
88
#include "build-info.h"
99
#include "grammar-parser.h"
10+
#include <regex>
1011

1112
#ifndef NDEBUG
1213
// crash the server in debug mode, otherwise send an http 500 error
@@ -1385,6 +1386,10 @@ class llamaCPP : public drogon::HttpSimpleController<llamaCPP> {
13851386
params.model = conf["llama_model_path"].asString();
13861387
params.n_gpu_layers = conf["ngl"].asInt();
13871388
params.n_ctx = conf["ctx_len"].asInt();
1389+
#ifdef GGML_USE_CUBLAS
1390+
LOG_INFO << "Setting up GGML CUBLAS PARAMS";
1391+
params.mul_mat_q = false;
1392+
#endif // GGML_USE_CUBLAS
13881393
if (params.model_alias == "unknown") {
13891394
params.model_alias = params.model;
13901395
}

controllers/nitro_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ inline void nitro_logo(){
5050
std::cout << resetColor << c;
5151
colorIndex = 0;
5252
} else {
53-
std::cout << rainbowColors[colorIndex % 6] << c;
53+
std::cout << rainbowColors[colorIndex % 2] << c;
5454
colorIndex++;
5555
}
5656
}

0 commit comments

Comments
 (0)