Skip to content

Commit fdb4515

Browse files
authored
feat(llama.cpp): Totally decentralized, private, distributed, p2p inference (#2343)
* feat(llama.cpp): Enable decentralized, distributed inference As #2324 introduced distributed inferencing thanks to @rgerganov implementation in ggml-org/llama.cpp#6829 in upstream llama.cpp, now it is possible to distribute the workload to remote llama.cpp gRPC server. This changeset now uses mudler/edgevpn to establish a secure, distributed network between the nodes using a shared token. The token is generated automatically when starting the server with the `--p2p` flag, and can be used by starting the workers with `local-ai worker p2p-llama-cpp-rpc` by passing the token via environment variable (TOKEN) or with args (--token). As per how mudler/edgevpn works, a network is established between the server and the workers with dht and mdns discovery protocols, the llama.cpp rpc server is automatically started and exposed to the underlying p2p network so the API server can connect on. When the HTTP server is started, it will discover the workers in the network and automatically create the port-forwards to the service locally. Then llama.cpp is configured to use the services. This feature is behind the "p2p" GO_FLAGS Signed-off-by: Ettore Di Giacinto <[email protected]> * go mod tidy Signed-off-by: Ettore Di Giacinto <[email protected]> * ci: add p2p tag Signed-off-by: Ettore Di Giacinto <[email protected]> * better message Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 16474bf commit fdb4515

File tree

17 files changed

+1243
-70
lines changed

17 files changed

+1243
-70
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
6262
export PATH=$PATH:$GOPATH/bin
6363
export PATH=/usr/local/cuda/bin:$PATH
64-
make dist
64+
GO_TAGS=p2p make dist
6565
- uses: actions/upload-artifact@v4
6666
with:
6767
name: LocalAI-linux
@@ -121,7 +121,7 @@ jobs:
121121
export C_INCLUDE_PATH=/usr/local/include
122122
export CPLUS_INCLUDE_PATH=/usr/local/include
123123
export PATH=$PATH:$GOPATH/bin
124-
make dist
124+
GO_TAGS=p2p make dist
125125
- uses: actions/upload-artifact@v4
126126
with:
127127
name: LocalAI-MacOS-arm64

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ARG TARGETVARIANT
1414
ENV DEBIAN_FRONTEND=noninteractive
1515
ENV EXTERNAL_GRPC_BACKENDS="coqui:/build/backend/python/coqui/run.sh,huggingface-embeddings:/build/backend/python/sentencetransformers/run.sh,petals:/build/backend/python/petals/run.sh,transformers:/build/backend/python/transformers/run.sh,sentencetransformers:/build/backend/python/sentencetransformers/run.sh,rerankers:/build/backend/python/rerankers/run.sh,autogptq:/build/backend/python/autogptq/run.sh,bark:/build/backend/python/bark/run.sh,diffusers:/build/backend/python/diffusers/run.sh,exllama:/build/backend/python/exllama/run.sh,openvoice:/build/backend/python/openvoice/run.sh,vall-e-x:/build/backend/python/vall-e-x/run.sh,vllm:/build/backend/python/vllm/run.sh,mamba:/build/backend/python/mamba/run.sh,exllama2:/build/backend/python/exllama2/run.sh,transformers-musicgen:/build/backend/python/transformers-musicgen/run.sh,parler-tts:/build/backend/python/parler-tts/run.sh"
1616

17-
ARG GO_TAGS="stablediffusion tinydream tts"
17+
ARG GO_TAGS="stablediffusion tinydream tts p2p"
1818

1919
RUN apt-get update && \
2020
apt-get install -y --no-install-recommends \

core/cli/cli.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
package cli
22

3-
import "embed"
4-
5-
type Context struct {
6-
Debug bool `env:"LOCALAI_DEBUG,DEBUG" default:"false" hidden:"" help:"DEPRECATED, use --log-level=debug instead. Enable debug logging"`
7-
LogLevel *string `env:"LOCALAI_LOG_LEVEL" enum:"error,warn,info,debug,trace" help:"Set the level of logs to output [${enum}]"`
8-
9-
// This field is not a command line argument/flag, the struct tag excludes it from the parsed CLI
10-
BackendAssets embed.FS `kong:"-"`
11-
}
3+
import (
4+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
5+
"github.com/go-skynet/LocalAI/core/cli/worker"
6+
)
127

138
var CLI struct {
14-
Context `embed:""`
9+
cliContext.Context `embed:""`
1510

16-
Run RunCMD `cmd:"" help:"Run LocalAI, this the default command if no other command is specified. Run 'local-ai run --help' for more information" default:"withargs"`
17-
Models ModelsCMD `cmd:"" help:"Manage LocalAI models and definitions"`
18-
TTS TTSCMD `cmd:"" help:"Convert text to speech"`
19-
Transcript TranscriptCMD `cmd:"" help:"Convert audio to text"`
20-
LLAMACPPWorker LLAMACPPWorkerCMD `cmd:"" help:"Run workers to distribute workload (llama.cpp-only)"`
11+
Run RunCMD `cmd:"" help:"Run LocalAI, this the default command if no other command is specified. Run 'local-ai run --help' for more information" default:"withargs"`
12+
Models ModelsCMD `cmd:"" help:"Manage LocalAI models and definitions"`
13+
TTS TTSCMD `cmd:"" help:"Convert text to speech"`
14+
Transcript TranscriptCMD `cmd:"" help:"Convert audio to text"`
15+
Worker worker.Worker `cmd:"" help:"Run workers to distribute workload (llama.cpp-only)"`
2116
}

core/cli/context/context.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package cliContext
2+
3+
import "embed"
4+
5+
type Context struct {
6+
Debug bool `env:"LOCALAI_DEBUG,DEBUG" default:"false" hidden:"" help:"DEPRECATED, use --log-level=debug instead. Enable debug logging"`
7+
LogLevel *string `env:"LOCALAI_LOG_LEVEL" enum:"error,warn,info,debug,trace" help:"Set the level of logs to output [${enum}]"`
8+
9+
// This field is not a command line argument/flag, the struct tag excludes it from the parsed CLI
10+
BackendAssets embed.FS `kong:"-"`
11+
}

core/cli/models.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"encoding/json"
55
"fmt"
66

7+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
8+
79
"github.com/go-skynet/LocalAI/pkg/gallery"
810
"github.com/rs/zerolog/log"
911
"github.com/schollz/progressbar/v3"
@@ -29,7 +31,7 @@ type ModelsCMD struct {
2931
Install ModelsInstall `cmd:"" help:"Install a model from the gallery"`
3032
}
3133

32-
func (ml *ModelsList) Run(ctx *Context) error {
34+
func (ml *ModelsList) Run(ctx *cliContext.Context) error {
3335
var galleries []gallery.Gallery
3436
if err := json.Unmarshal([]byte(ml.Galleries), &galleries); err != nil {
3537
log.Error().Err(err).Msg("unable to load galleries")
@@ -49,7 +51,7 @@ func (ml *ModelsList) Run(ctx *Context) error {
4951
return nil
5052
}
5153

52-
func (mi *ModelsInstall) Run(ctx *Context) error {
54+
func (mi *ModelsInstall) Run(ctx *cliContext.Context) error {
5355
modelName := mi.ModelArgs[0]
5456

5557
var galleries []gallery.Gallery

core/cli/run.go

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package cli
22

33
import (
4+
"context"
45
"fmt"
56
"strings"
67
"time"
78

9+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
810
"github.com/go-skynet/LocalAI/core/config"
911
"github.com/go-skynet/LocalAI/core/http"
12+
"github.com/go-skynet/LocalAI/core/p2p"
1013
"github.com/go-skynet/LocalAI/core/startup"
1114
"github.com/rs/zerolog"
1215
"github.com/rs/zerolog/log"
@@ -37,13 +40,14 @@ type RunCMD struct {
3740
Threads int `env:"LOCALAI_THREADS,THREADS" short:"t" default:"4" help:"Number of threads used for parallel computation. Usage of the number of physical cores in the system is suggested" group:"performance"`
3841
ContextSize int `env:"LOCALAI_CONTEXT_SIZE,CONTEXT_SIZE" default:"512" help:"Default context size for models" group:"performance"`
3942

40-
Address string `env:"LOCALAI_ADDRESS,ADDRESS" default:":8080" help:"Bind address for the API server" group:"api"`
41-
CORS bool `env:"LOCALAI_CORS,CORS" help:"" group:"api"`
42-
CORSAllowOrigins string `env:"LOCALAI_CORS_ALLOW_ORIGINS,CORS_ALLOW_ORIGINS" group:"api"`
43-
UploadLimit int `env:"LOCALAI_UPLOAD_LIMIT,UPLOAD_LIMIT" default:"15" help:"Default upload-limit in MB" group:"api"`
44-
APIKeys []string `env:"LOCALAI_API_KEY,API_KEY" help:"List of API Keys to enable API authentication. When this is set, all the requests must be authenticated with one of these API keys" group:"api"`
45-
DisableWebUI bool `env:"LOCALAI_DISABLE_WEBUI,DISABLE_WEBUI" default:"false" help:"Disable webui" group:"api"`
46-
43+
Address string `env:"LOCALAI_ADDRESS,ADDRESS" default:":8080" help:"Bind address for the API server" group:"api"`
44+
CORS bool `env:"LOCALAI_CORS,CORS" help:"" group:"api"`
45+
CORSAllowOrigins string `env:"LOCALAI_CORS_ALLOW_ORIGINS,CORS_ALLOW_ORIGINS" group:"api"`
46+
UploadLimit int `env:"LOCALAI_UPLOAD_LIMIT,UPLOAD_LIMIT" default:"15" help:"Default upload-limit in MB" group:"api"`
47+
APIKeys []string `env:"LOCALAI_API_KEY,API_KEY" help:"List of API Keys to enable API authentication. When this is set, all the requests must be authenticated with one of these API keys" group:"api"`
48+
DisableWebUI bool `env:"LOCALAI_DISABLE_WEBUI,DISABLE_WEBUI" default:"false" help:"Disable webui" group:"api"`
49+
Peer2Peer bool `env:"LOCALAI_P2P,P2P" name:"p2p" default:"false" help:"Enable P2P mode" group:"p2p"`
50+
Peer2PeerToken string `env:"LOCALAI_P2P_TOKEN,P2P_TOKEN" name:"p2ptoken" help:"Token for P2P mode (optional)" group:"p2p"`
4751
ParallelRequests bool `env:"LOCALAI_PARALLEL_REQUESTS,PARALLEL_REQUESTS" help:"Enable backends to handle multiple requests in parallel if they support it (e.g.: llama.cpp or vllm)" group:"backends"`
4852
SingleActiveBackend bool `env:"LOCALAI_SINGLE_ACTIVE_BACKEND,SINGLE_ACTIVE_BACKEND" help:"Allow only one backend to be run at a time" group:"backends"`
4953
PreloadBackendOnly bool `env:"LOCALAI_PRELOAD_BACKEND_ONLY,PRELOAD_BACKEND_ONLY" default:"false" help:"Do not launch the API services, only the preloaded models / backends are started (useful for multi-node setups)" group:"backends"`
@@ -54,7 +58,7 @@ type RunCMD struct {
5458
WatchdogBusyTimeout string `env:"LOCALAI_WATCHDOG_BUSY_TIMEOUT,WATCHDOG_BUSY_TIMEOUT" default:"5m" help:"Threshold beyond which a busy backend should be stopped" group:"backends"`
5559
}
5660

57-
func (r *RunCMD) Run(ctx *Context) error {
61+
func (r *RunCMD) Run(ctx *cliContext.Context) error {
5862
opts := []config.AppOption{
5963
config.WithConfigFile(r.ModelsConfigFile),
6064
config.WithJSONStringPreload(r.PreloadModels),
@@ -81,6 +85,31 @@ func (r *RunCMD) Run(ctx *Context) error {
8185
config.WithModelsURL(append(r.Models, r.ModelArgs...)...),
8286
}
8387

88+
if r.Peer2Peer || r.Peer2PeerToken != "" {
89+
log.Info().Msg("P2P mode enabled")
90+
token := r.Peer2PeerToken
91+
if token == "" {
92+
// IF no token is provided, and p2p is enabled,
93+
// we generate one and wait for the user to pick up the token (this is for interactive)
94+
log.Info().Msg("No token provided, generating one")
95+
token = p2p.GenerateToken()
96+
log.Info().Msg("Generated Token:")
97+
fmt.Println(token)
98+
99+
log.Info().Msg("To use the token, you can run the following command in another node or terminal:")
100+
fmt.Printf("export TOKEN=\"%s\"\nlocal-ai worker p2p-llama-cpp-rpc\n", token)
101+
102+
// Ask for user confirmation
103+
log.Info().Msg("Press a button to proceed")
104+
var input string
105+
fmt.Scanln(&input)
106+
}
107+
log.Info().Msg("Starting P2P server discovery...")
108+
if err := p2p.LLamaCPPRPCServerDiscoverer(context.Background(), token); err != nil {
109+
return err
110+
}
111+
}
112+
84113
idleWatchDog := r.EnableWatchdogIdle
85114
busyWatchDog := r.EnableWatchdogBusy
86115

core/cli/transcript.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77

88
"github.com/go-skynet/LocalAI/core/backend"
9+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
910
"github.com/go-skynet/LocalAI/core/config"
1011
"github.com/go-skynet/LocalAI/pkg/model"
1112
"github.com/rs/zerolog/log"
@@ -22,7 +23,7 @@ type TranscriptCMD struct {
2223
BackendAssetsPath string `env:"LOCALAI_BACKEND_ASSETS_PATH,BACKEND_ASSETS_PATH" type:"path" default:"/tmp/localai/backend_data" help:"Path used to extract libraries that are required by some of the backends in runtime" group:"storage"`
2324
}
2425

25-
func (t *TranscriptCMD) Run(ctx *Context) error {
26+
func (t *TranscriptCMD) Run(ctx *cliContext.Context) error {
2627
opts := &config.ApplicationConfig{
2728
ModelPath: t.ModelsPath,
2829
Context: context.Background(),

core/cli/tts.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"strings"
99

1010
"github.com/go-skynet/LocalAI/core/backend"
11+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
1112
"github.com/go-skynet/LocalAI/core/config"
1213
"github.com/go-skynet/LocalAI/pkg/model"
1314
"github.com/rs/zerolog/log"
@@ -24,7 +25,7 @@ type TTSCMD struct {
2425
BackendAssetsPath string `env:"LOCALAI_BACKEND_ASSETS_PATH,BACKEND_ASSETS_PATH" type:"path" default:"/tmp/localai/backend_data" help:"Path used to extract libraries that are required by some of the backends in runtime" group:"storage"`
2526
}
2627

27-
func (t *TTSCMD) Run(ctx *Context) error {
28+
func (t *TTSCMD) Run(ctx *cliContext.Context) error {
2829
outputFile := t.OutputFile
2930
outputDir := t.BackendAssetsPath
3031
if outputFile != "" {

core/cli/worker/worker.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package worker
2+
3+
type WorkerFlags struct {
4+
BackendAssetsPath string `env:"LOCALAI_BACKEND_ASSETS_PATH,BACKEND_ASSETS_PATH" type:"path" default:"/tmp/localai/backend_data" help:"Path used to extract libraries that are required by some of the backends in runtime" group:"storage"`
5+
}
6+
7+
type Worker struct {
8+
P2P P2P `cmd:"" name:"p2p-llama-cpp-rpc" help:"Starts a LocalAI llama.cpp worker in P2P mode (requires a token)"`
9+
LLamaCPP LLamaCPP `cmd:"" name:"llama-cpp-rpc" help:"Starts a llama.cpp worker in standalone mode"`
10+
}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
package cli
1+
package worker
22

33
import (
4+
"fmt"
45
"os"
56
"syscall"
67

8+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
79
"github.com/go-skynet/LocalAI/pkg/assets"
810
"github.com/rs/zerolog/log"
911
)
1012

11-
type LLAMACPPWorkerCMD struct {
12-
Args []string `arg:"" optional:"" name:"models" help:"Worker arguments: host port"`
13-
BackendAssetsPath string `env:"LOCALAI_BACKEND_ASSETS_PATH,BACKEND_ASSETS_PATH" type:"path" default:"/tmp/localai/backend_data" help:"Path used to extract libraries that are required by some of the backends in runtime" group:"storage"`
13+
type LLamaCPP struct {
14+
Args []string `arg:"" optional:"" name:"models" help:"Model configuration URLs to load"`
15+
WorkerFlags `embed:""`
1416
}
1517

16-
func (r *LLAMACPPWorkerCMD) Run(ctx *Context) error {
18+
func (r *LLamaCPP) Run(ctx *cliContext.Context) error {
1719
// Extract files from the embedded FS
1820
err := assets.ExtractFiles(ctx.BackendAssets, r.BackendAssetsPath)
1921
log.Debug().Msgf("Extracting backend assets files to %s", r.BackendAssetsPath)
2022
if err != nil {
2123
log.Warn().Msgf("Failed extracting backend assets files: %s (might be required for some backends to work properly, like gpt4all)", err)
2224
}
2325

26+
if len(os.Args) < 4 {
27+
return fmt.Errorf("usage: local-ai worker llama-cpp-rpc -- <llama-rpc-server-args>")
28+
}
29+
2430
return syscall.Exec(
2531
assets.ResolvePath(
2632
r.BackendAssetsPath,
@@ -32,6 +38,6 @@ func (r *LLAMACPPWorkerCMD) Run(ctx *Context) error {
3238
r.BackendAssetsPath,
3339
"util",
3440
"llama-cpp-rpc-server",
35-
)}, r.Args...),
41+
)}, os.Args[4:]...),
3642
os.Environ())
3743
}

core/cli/worker/worker_nop2p.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//go:build !p2p
2+
// +build !p2p
3+
4+
package worker
5+
6+
import (
7+
"fmt"
8+
9+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
10+
)
11+
12+
type P2P struct{}
13+
14+
func (r *P2P) Run(ctx *cliContext.Context) error {
15+
return fmt.Errorf("p2p mode is not enabled in this build")
16+
}

core/cli/worker/worker_p2p.go

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
//go:build p2p
2+
// +build p2p
3+
4+
package worker
5+
6+
import (
7+
"context"
8+
"fmt"
9+
"os"
10+
"os/exec"
11+
"time"
12+
13+
cliContext "github.com/go-skynet/LocalAI/core/cli/context"
14+
"github.com/go-skynet/LocalAI/core/p2p"
15+
"github.com/go-skynet/LocalAI/pkg/assets"
16+
"github.com/phayes/freeport"
17+
"github.com/rs/zerolog/log"
18+
)
19+
20+
type P2P struct {
21+
WorkerFlags `embed:""`
22+
Token string `env:"LOCALAI_TOKEN,TOKEN" help:"JSON list of galleries"`
23+
NoRunner bool `env:"LOCALAI_NO_RUNNER,NO_RUNNER" help:"Do not start the llama-cpp-rpc-server"`
24+
RunnerAddress string `env:"LOCALAI_RUNNER_ADDRESS,RUNNER_ADDRESS" help:"Address of the llama-cpp-rpc-server"`
25+
RunnerPort string `env:"LOCALAI_RUNNER_PORT,RUNNER_PORT" help:"Port of the llama-cpp-rpc-server"`
26+
ExtraLLamaCPPArgs []string `env:"LOCALAI_EXTRA_LLAMA_CPP_ARGS,EXTRA_LLAMA_CPP_ARGS" help:"Extra arguments to pass to llama-cpp-rpc-server"`
27+
}
28+
29+
func (r *P2P) Run(ctx *cliContext.Context) error {
30+
// Extract files from the embedded FS
31+
err := assets.ExtractFiles(ctx.BackendAssets, r.BackendAssetsPath)
32+
log.Debug().Msgf("Extracting backend assets files to %s", r.BackendAssetsPath)
33+
if err != nil {
34+
log.Warn().Msgf("Failed extracting backend assets files: %s (might be required for some backends to work properly, like gpt4all)", err)
35+
}
36+
37+
// Check if the token is set
38+
// as we always need it.
39+
if r.Token == "" {
40+
return fmt.Errorf("Token is required")
41+
}
42+
43+
port, err := freeport.GetFreePort()
44+
if err != nil {
45+
return err
46+
}
47+
48+
address := "127.0.0.1"
49+
50+
if r.NoRunner {
51+
// Let override which port and address to bind if the user
52+
// configure the llama-cpp service on its own
53+
p := fmt.Sprint(port)
54+
if r.RunnerAddress != "" {
55+
address = r.RunnerAddress
56+
}
57+
if r.RunnerPort != "" {
58+
p = r.RunnerPort
59+
}
60+
61+
err = p2p.BindLLamaCPPWorker(context.Background(), address, p, r.Token)
62+
if err != nil {
63+
return err
64+
}
65+
log.Info().Msgf("You need to start llama-cpp-rpc-server on '%s:%s'", address, p)
66+
67+
return nil
68+
}
69+
70+
// Start llama.cpp directly from the version we have pre-packaged
71+
go func() {
72+
for {
73+
log.Info().Msgf("Starting llama-cpp-rpc-server on '%s:%d'", address, port)
74+
cmd := exec.Command(
75+
assets.ResolvePath(
76+
r.BackendAssetsPath,
77+
"util",
78+
"llama-cpp-rpc-server",
79+
),
80+
append([]string{"--host", address, "--port", fmt.Sprint(port)}, r.ExtraLLamaCPPArgs...)...,
81+
)
82+
83+
cmd.Env = os.Environ()
84+
85+
cmd.Stderr = os.Stdout
86+
cmd.Stdout = os.Stdout
87+
88+
if err := cmd.Start(); err != nil {
89+
log.Error().Err(err).Msg("Failed to start llama-cpp-rpc-server")
90+
}
91+
92+
cmd.Wait()
93+
}
94+
}()
95+
96+
err = p2p.BindLLamaCPPWorker(context.Background(), address, fmt.Sprint(port), r.Token)
97+
if err != nil {
98+
return err
99+
}
100+
101+
for {
102+
time.Sleep(1 * time.Second)
103+
}
104+
}

0 commit comments

Comments
 (0)