Skip to content

Commit 1851b0b

Browse files
committed
Merge branch 'concedo_experimental' into croco_nex_0
2 parents 8df240b + aacb6c3 commit 1851b0b

10 files changed

+27
-16
lines changed

.github/workflows/kcpp-build-release-win-cuda.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
mkdir build
2626
cd build
2727
cmake .. -DLLAMA_CUBLAS=ON -DCMAKE_SYSTEM_VERSION="10.0.19041.0"
28-
cmake --build . --config Release -j 1
28+
cmake --build . --config Release -j 2
2929
3030
- name: Save artifact
3131
uses: actions/upload-artifact@v3

.github/workflows/kcpp-build-release-win-cuda12.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
mkdir build
2626
cd build
2727
cmake .. -DLLAMA_CUBLAS=ON -DCMAKE_SYSTEM_VERSION="10.0.19041.0"
28-
cmake --build . --config Release -j 1
28+
cmake --build . --config Release -j 2
2929
3030
- name: Save artifact
3131
uses: actions/upload-artifact@v3

.github/workflows/kcpp-build-release-win-full-cu12.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
mkdir build
5959
cd build
6060
cmake .. -DLLAMA_CUBLAS=ON -DCMAKE_SYSTEM_VERSION="10.0.19041.0"
61-
cmake --build . --config Release -j 1
61+
cmake --build . --config Release -j 2
6262
mv bin/Release/koboldcpp_cublas.dll ../koboldcpp_cublas.dll
6363
cd ..
6464

.github/workflows/kcpp-build-release-win-full.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
mkdir build
5959
cd build
6060
cmake .. -DLLAMA_CUBLAS=ON -DCMAKE_SYSTEM_VERSION="10.0.19041.0"
61-
cmake --build . --config Release -j 1
61+
cmake --build . --config Release -j 2
6262
mv bin/Release/koboldcpp_cublas.dll ../koboldcpp_cublas.dll
6363
cd ..
6464

.github/workflows/kcpp-build-release-win-oldcpu-full.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
mkdir build
5959
cd build
6060
cmake .. -DLLAMA_CUBLAS=ON -DLLAMA_AVX2=OFF -DCMAKE_SYSTEM_VERSION="10.0.19041.0"
61-
cmake --build . --config Release -j 1
61+
cmake --build . --config Release -j 2
6262
mv bin/Release/koboldcpp_cublas.dll ../koboldcpp_cublas.dll
6363
cd ..
6464

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ ifdef LLAMA_CUBLAS
235235
CUBLAS_FLAGS = -DGGML_USE_CUDA -DSD_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
236236
CUBLASLD_FLAGS = -lcuda -lcublas -lcudart -lcublasLt -lpthread -ldl -lrt -L/usr/local/cuda/lib64 -L/opt/cuda/lib64 -L$(CUDA_PATH)/targets/x86_64-linux/lib -L$(CUDA_PATH)/lib64/stubs -L/usr/local/cuda/targets/aarch64-linux/lib -L/usr/local/cuda/targets/sbsa-linux/lib -L/usr/lib/wsl/lib
237237
CUBLAS_OBJS = ggml-cuda.o ggml_v3-cuda.o ggml_v2-cuda.o ggml_v2-cuda-legacy.o
238-
CUBLAS_OBJS += $(patsubst %.cu,%.o,$(wildcard ggml/src/ggml-cuda/*.cu))
238+
CUBLAS_OBJS += $(patsubst %.cu,%.o,$(filter-out ggml/src/ggml-cuda/ggml-cuda.cu, $(wildcard ggml/src/ggml-cuda/*.cu)))
239239
CUBLAS_OBJS += $(OBJS_CUDA_TEMP_INST)
240240
NVCC = nvcc
241241
NVCCFLAGS = --forward-unknown-to-host-compiler -use_fast_math
@@ -321,7 +321,7 @@ ifdef LLAMA_HIPBLAS
321321
HIPLDFLAGS += -L$(ROCM_PATH)/lib64 -Wl,-rpath=$(ROCM_PATH)/lib64
322322
HIPLDFLAGS += -lhipblas -lamdhip64 -lrocblas
323323
HIP_OBJS += ggml-cuda.o ggml_v3-cuda.o ggml_v2-cuda.o ggml_v2-cuda-legacy.o
324-
HIP_OBJS += $(patsubst %.cu,%.o,$(wildcard ggml/src/ggml-cuda/*.cu))
324+
HIP_OBJS += $(patsubst %.cu,%.o,$(filter-out ggml/src/ggml-cuda/ggml-cuda.cu, $(wildcard ggml/src/ggml-cuda/*.cu)))
325325
HIP_OBJS += $(OBJS_CUDA_TEMP_INST)
326326

327327
HIPFLAGS2 += $(addprefix --offload-arch=,$(GPU_TARGETS))
@@ -350,7 +350,7 @@ ifdef LLAMA_METAL
350350

351351
ggml-metal.o: ggml/src/ggml-metal/ggml-metal.m ggml/include/ggml-metal.h
352352
@echo "== Preparing merged Metal file =="
353-
@sed -e '/#include "ggml-common.h"/r ggml/src/ggml-common.h' -e '/#include "ggml-common.h"/d' < ggml/src/ggml-metal/ggml-metal.metal > ggml/src/ggml-metal-merged.metal
353+
@sed -e '/#include "..\/ggml-common.h"/r ggml/src/ggml-common.h' -e '/#include "..\/ggml-common.h"/d' < ggml/src/ggml-metal/ggml-metal.metal > ggml/src/ggml-metal-merged.metal
354354
@cp ggml/src/ggml-metal-merged.metal ./ggml-metal-merged.metal
355355
$(CC) $(CFLAGS) -c $< -o $@
356356
endif # LLAMA_METAL

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ when you can't use the precompiled binary directly, we provide an automated buil
134134
- You can also use `nix3-run` to use KoboldCpp: `nix run --expr ``with import <nixpkgs> { config = { allowUnfree = true; cudaSupport = true; }; }; koboldcpp`` --impure`
135135
- Or use `nix-shell`: `nix-shell --expr 'with import <nixpkgs> { config = { allowUnfree = true; cudaSupport = true; }; }; koboldcpp' --run "koboldcpp" --impure`
136136
- Packages (like CLBLast, Vulkan, etc.) can be overridden, please refer to the [17th Nix Pill - Nixpkgs Overriding Packages](https://nixos.org/guides/nix-pills/17-nixpkgs-overriding-packages)
137+
- [GPTLocalhost](https://gptlocalhost.com/demo#KoboldCpp) - KoboldCpp is supported by GPTLocalhost, a local Word Add-in for you to use KoboldCpp in Microsoft Word. A local alternative to "Copilot in Word."
137138

138139
## Questions and Help Wiki
139140
- **First, please check out [The KoboldCpp FAQ and Knowledgebase](https://github.com/LostRuins/koboldcpp/wiki) which may already have answers to your questions! Also please search through past issues and discussions.**

ggml/src/ggml.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#elif GGML_USE_LLAMA_CPP_MAINLINE
1212
#include "ggml-backend.h"
1313
#include "ggml-impl.h"
14+
#include "ggml-cpu-impl.h"
1415
#include "ggml-threading.h"
1516
#include "ggml.h"
1617

kcpp_docs.embd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
},
395395
"hordeexitcounter": {
396396
"type": "integer",
397-
"description": "Status of embedded horde worker. If it's too high, may have crashed."
397+
"description": "Status of embedded horde worker, if applicable. If it's too high, may have crashed."
398398
},
399399
"uptime": {
400400
"type": "integer",
@@ -432,7 +432,7 @@
432432
"description": "Successful request"
433433
}
434434
},
435-
"summary": "Retrieve the current max context length setting value that horde sees",
435+
"summary": "Retrieve the current max context length setting value that public backends see",
436436
"tags": [
437437
"api/v1"
438438
]

koboldcpp.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
runmode_untouched = True
7575
modelfile_extracted_meta = None
7676
importvars_in_progress = False
77+
has_multiplayer = False
7778
preloaded_story = None
7879
chatcompl_adapter = None
7980
embedded_kailite = None
@@ -2084,7 +2085,7 @@ def noscript_webui(self):
20842085

20852086
def do_GET(self):
20862087
global embedded_kailite, embedded_kcpp_docs, embedded_kcpp_sdui
2087-
global maxctx, maxhordelen, friendlymodelname, KcppVersion, totalgens, preloaded_story, exitcounter, currentusergenkey, friendlysdmodelname, fullsdmodelpath, mmprojpath, password, fullwhispermodelpath
2088+
global has_multiplayer, maxctx, maxhordelen, friendlymodelname, KcppVersion, totalgens, preloaded_story, exitcounter, currentusergenkey, friendlysdmodelname, fullsdmodelpath, mmprojpath, password, fullwhispermodelpath
20882089
self.path = self.path.rstrip('/')
20892090
response_body = None
20902091
content_type = 'application/json'
@@ -2141,7 +2142,7 @@ def do_GET(self):
21412142
has_vision = (mmprojpath!="")
21422143
has_password = (password!="")
21432144
has_whisper = (fullwhispermodelpath!="")
2144-
response_body = (json.dumps({"result":"KoboldCpp/Croco.Cpp","version":KcppVersion, "protected":has_password ,"txt2img":has_txt2img,"vision":has_vision,"transcribe":has_whisper}).encode())
2145+
response_body = (json.dumps({"result":"KoboldCpp/Croco.Cpp","version":KcppVersion, "protected":has_password ,"txt2img":has_txt2img,"vision":has_vision,"transcribe":has_whisper,"multiplayer":has_multiplayer}).encode())
21452146

21462147
elif self.path.endswith(('/api/extra/perf')):
21472148
global last_req_time, start_time
@@ -2845,6 +2846,7 @@ def hide_tooltip(event):
28452846
port_var = ctk.StringVar(value=defaultport)
28462847
host_var = ctk.StringVar(value="")
28472848
multiuser_var = ctk.IntVar(value=1)
2849+
multiplayer_var = ctk.IntVar(value=has_multiplayer)
28482850
horde_name_var = ctk.StringVar(value="koboldcpp")
28492851
horde_gen_var = ctk.StringVar(value=maxhordelen)
28502852
horde_context_var = ctk.StringVar(value=maxhordectx)
@@ -3375,10 +3377,11 @@ def pickpremadetemplate():
33753377
makecheckbox(network_tab, "Remote Tunnel", remotetunnel, 3, 1,tooltiptxt="Creates a trycloudflare tunnel.\nAllows you to access KoboldCpp/Croco.Cpp from other devices over an internet URL.")
33763378
makecheckbox(network_tab, "Quiet Mode", quietmode, 4,tooltiptxt="Prevents all generation related terminal output from being displayed.")
33773379
makecheckbox(network_tab, "NoCertify Mode (Insecure)", nocertifymode, 4, 1,tooltiptxt="Allows insecure SSL connections. Use this if you have cert errors and need to bypass certificate restrictions.")
3380+
makecheckbox(network_tab, "Shared Multiplayer", multiplayer_var, 5,tooltiptxt="Hosts a shared multiplayer session that others can join.")
33783381

3379-
makefileentry(network_tab, "SSL Cert:", "Select SSL cert.pem file",ssl_cert_var, 5, width=200 ,filetypes=[("Unencrypted Certificate PEM", "*.pem")], singlerow=True, singlecol=False,tooltiptxt="Select your unencrypted .pem SSL certificate file for https.\nCan be generated with OpenSSL.")
3380-
makefileentry(network_tab, "SSL Key:", "Select SSL key.pem file", ssl_key_var, 7, width=200, filetypes=[("Unencrypted Key PEM", "*.pem")], singlerow=True, singlecol=False, tooltiptxt="Select your unencrypted .pem SSL key file for https.\nCan be generated with OpenSSL.")
3381-
makelabelentry(network_tab, "Password: ", password_var, 8, 200,tooltip="Enter a password required to use this instance.\nThis key will be required for all text endpoints.\nImage endpoints are not secured.")
3382+
makefileentry(network_tab, "SSL Cert:", "Select SSL cert.pem file",ssl_cert_var, 7, width=200 ,filetypes=[("Unencrypted Certificate PEM", "*.pem")], singlerow=True, singlecol=False,tooltiptxt="Select your unencrypted .pem SSL certificate file for https.\nCan be generated with OpenSSL.")
3383+
makefileentry(network_tab, "SSL Key:", "Select SSL key.pem file", ssl_key_var, 9, width=200, filetypes=[("Unencrypted Key PEM", "*.pem")], singlerow=True, singlecol=False, tooltiptxt="Select your unencrypted .pem SSL key file for https.\nCan be generated with OpenSSL.")
3384+
makelabelentry(network_tab, "Password: ", password_var, 10, 200,tooltip="Enter a password required to use this instance.\nThis key will be required for all text endpoints.\nImage endpoints are not secured.")
33823385

33833386
# Horde Tab
33843387
horde_tab = tabcontent["Horde Worker"]
@@ -3632,6 +3635,7 @@ def export_vars():
36323635
args.port_param = defaultport if port_var.get()=="" else int(port_var.get())
36333636
args.host = host_var.get()
36343637
args.multiuser = multiuser_var.get()
3638+
args.multiplayer = (multiplayer_var.get()==1)
36353639

36363640
if usehorde_var.get() != 0:
36373641
args.hordemodelname = horde_name_var.get()
@@ -3808,6 +3812,7 @@ def import_vars(dict):
38083812
port_var.set(dict["port_param"] if ("port_param" in dict and dict["port_param"]) else defaultport)
38093813
host_var.set(dict["host"] if ("host" in dict and dict["host"]) else "")
38103814
multiuser_var.set(dict["multiuser"] if ("multiuser" in dict) else 1)
3815+
multiplayer_var.set(dict["multiplayer"] if ("multiplayer" in dict) else 0)
38113816

38123817
horde_name_var.set(dict["hordemodelname"] if ("hordemodelname" in dict and dict["hordemodelname"]) else "koboldcpp")
38133818
horde_context_var.set(dict["hordemaxctx"] if ("hordemaxctx" in dict and dict["hordemaxctx"]) else maxhordectx)
@@ -4604,7 +4609,7 @@ def main(launch_args,start_server=True):
46044609
friendlymodelname = "koboldcpp/" + sanitize_string(newmdldisplayname)
46054610

46064611
# horde worker settings
4607-
global maxhordelen, maxhordectx, showdebug
4612+
global maxhordelen, maxhordectx, showdebug, has_multiplayer
46084613
if args.hordemodelname and args.hordemodelname!="":
46094614
friendlymodelname = args.hordemodelname
46104615
if args.debugmode == 1:
@@ -4622,6 +4627,9 @@ def main(launch_args,start_server=True):
46224627
if args.debugmode != 1:
46234628
showdebug = False
46244629

4630+
if args.multiplayer:
4631+
has_multiplayer = True
4632+
46254633
if args.highpriority:
46264634
print("Setting process to Higher Priority - Use Caution")
46274635
try:
@@ -5130,6 +5138,7 @@ def range_checker(arg: str):
51305138
advparser.add_argument("--prompt", metavar=('[prompt]'), help="Passing a prompt string triggers a direct inference, loading the model, outputs the response to stdout and exits. Can be used alone or with benchmark.", type=str, default="")
51315139
advparser.add_argument("--promptlimit", help="Sets the maximum number of generated tokens, usable only with --prompt or --benchmark",metavar=('[token limit]'), type=int, default=100)
51325140
advparser.add_argument("--multiuser", help="Runs in multiuser mode, which queues incoming requests instead of blocking them.", metavar=('limit'), nargs='?', const=1, type=int, default=1)
5141+
advparser.add_argument("--multiplayer", help="Hosts a shared multiplayer session that others can join.", action='store_true')
51335142
advparser.add_argument("--remotetunnel", help="Uses Cloudflare to create a remote tunnel, allowing you to access KoboldCpp/Croco.Cpp remotely over the internet even behind a firewall.", action='store_true')
51345143
advparser.add_argument("--highpriority", help="Experimental flag. If set, increases the process CPU priority, potentially speeding up generation. Use caution.", action='store_true')
51355144
advparser.add_argument("--foreground", help="Windows only. Sends the terminal to the foreground every time a new prompt is generated. This helps avoid some idle slowdown issues.", action='store_true')

0 commit comments

Comments
 (0)