summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineet Kumar <git@vineetk.net>2026-05-02 17:33:22 -0400
committerVineet Kumar <git@vineetk.net>2026-05-02 17:41:28 -0400
commite07c33fe14d150ed09ad7cc77355fe1750ba5618 (patch)
tree639533195021878e135955b013eedb6fe7b36652
parentfdd166c2f37f448b90022ff5d7c60dbd8610a90e (diff)
packages and services: drop llama-swap
I really really really don't like its codebase. Also extremely hard to package for its newer versions. I made a replacement instead that I need to package and make service for.
-rw-r--r--epistemia/packages/machine-learning.scm42
-rw-r--r--epistemia/services/machine-learning.scm58
2 files changed, 26 insertions, 74 deletions
diff --git a/epistemia/packages/machine-learning.scm b/epistemia/packages/machine-learning.scm
index 2a8b70a..70577c2 100644
--- a/epistemia/packages/machine-learning.scm
+++ b/epistemia/packages/machine-learning.scm
@@ -91,45 +91,3 @@
91 hipblas 91 hipblas
92 hipblas-common 92 hipblas-common
93 rocblas))))) 93 rocblas)))))
94
95(define-public llama-swap
96 (package
97 (name "llama-swap")
98 ;; after this is using react and then svelte instead of plain
99 ;; html. also no longer using google/shlex after this.
100 (version "115")
101 (source
102 (origin
103 (method git-fetch)
104 (uri (git-reference
105 (url "https://github.com/mostlygeek/llama-swap")
106 (commit (string-append "v" version))))
107 (file-name (git-file-name name version))
108 (sha256
109 (base32 "0g8shkyihfg5nan34fi3nyaww2a4mxvwy4w0drxd3ipfrxglj8ms"))))
110 (build-system go-build-system)
111 (arguments
112 (list
113 #:import-path "github.com/mostlygeek/llama-swap"
114 #:install-source? #f
115 #:phases
116 #~(modify-phases %standard-phases
117 (add-before 'check 'simple-responder
118 (lambda _
119 (with-directory-excursion "src/github.com/mostlygeek/llama-swap"
120 (invoke "make" "simple-responder")))))))
121 (native-inputs (list gnu-make))
122 (propagated-inputs (list go-github-com-fsnotify-fsnotify
123 go-github-com-gin-gonic-gin
124 go-github-com-google-shlex
125 go-github-com-tidwall-gjson
126 go-github-com-tidwall-sjson
127 go-github-com-stretchr-testify
128 go-gopkg-in-yaml-v3))
129 (home-page "https://github.com/mostlygeek/llama-swap")
130 (synopsis "llama-swap")
131 (description
132 "llama-swap is an @code{OpenAI} API compatible server that gives you complete
133control over how you use your hardware. It automatically swaps to the
134configuration of your choice for serving a model.")
135 (license license:expat)))
diff --git a/epistemia/services/machine-learning.scm b/epistemia/services/machine-learning.scm
index 3d94908..094049c 100644
--- a/epistemia/services/machine-learning.scm
+++ b/epistemia/services/machine-learning.scm
@@ -9,59 +9,53 @@
9 llama-swap-configuration? 9 llama-swap-configuration?
10 llama-swap-service-type)) 10 llama-swap-service-type))
11 11
12(define-record-type* <llama-swap-configuration> 12(define-record-type* <llm-router-configuration>
13 llama-swap-configuration make-llama-swap-configuration 13 llm-router-configuration make-llm-router-configuration
14 llama-swap-configuration? 14 llm-router-configuration?
15 (package llama-swap-configuration-package 15 (package llm-router-configuration-package
16 (default llama-swap)) 16 (default llm-router))
17 (llama-cpp llama-swap-configuration-llama-cpp 17 (llama-cpp llm-router-configuration-llama-cpp
18 (default llama-cpp)) 18 (default llama-cpp))
19 (config llama-swap-configuration-config) 19 (config llm-router-configuration-config)
20 (listen llama-swap-configuration-listen 20 (listen llm-router-configuration-listen
21 (default ":8080")) 21 (default ":8080"))
22 (watch-config? llama-swap-configuration-watch-config? 22 (watch-config? llm-router-configuration-watch-config?
23 (default #f))) 23 (default #f)))
24 24
25(define llama-swap-account-service 25(define llm-router-account-service
26 (list (user-account 26 (list (user-account
27 (name "llama-swap") 27 (name "llm-router")
28 (group "nogroup") 28 (group "nogroup")
29 (system? #t) 29 (system? #t)
30 (comment "llama-swap daemon user") 30 (comment "llm-router daemon user")
31 (home-directory "/var/empty") 31 (home-directory "/var/empty")
32 (shell (file-append shadow "/sbin/nologin"))))) 32 (shell (file-append shadow "/sbin/nologin")))))
33 33
34(define (llama-swap-shepherd-service config) 34(define (llm-router-shepherd-service config)
35 (let ((pkg (llama-swap-configuration-package config)) 35 (let ((pkg (llm-router-configuration-package config))
36 (lcpp (llama-swap-configuration-llama-cpp config)) 36 (lcpp (llm-router-configuration-llama-cpp config))
37 (cfg (llama-swap-configuration-config config)) 37 (cfg (llm-router-configuration-config config)))
38 (listen (llama-swap-configuration-listen config))
39 (watch? (llama-swap-configuration-watch-config? config)))
40 (list 38 (list
41 (shepherd-service 39 (shepherd-service
42 (documentation "llama-swap OpenAI-compatible model proxy") 40 (documentation "llm-router OpenAI-compatible model proxy")
43 (provision '(llama-swap)) 41 (provision '(llm-router))
44 (requirement '(networking)) 42 (requirement '(networking))
45 (start #~(make-forkexec-constructor 43 (start #~(make-forkexec-constructor
46 (append 44 (append
47 (list #$(file-append pkg "/bin/llama-swap") 45 (list #$(file-append pkg "/bin/llm-router")))
48 "-config" #$cfg 46 #:user "llm-router"
49 "-listen" #$listen)
50 (if #$watch? '("-watch-config") '()))
51 #:user "llama-swap"
52 #:environment-variables 47 #:environment-variables
53 (cons (string-append "PATH=" #$(file-append lcpp "/bin")) 48 (cons (string-append "PATH=" #$(file-append lcpp "/bin"))
54 (default-environment-variables)))) 49 (default-environment-variables))))
55 (stop #~(make-kill-destructor)))))) 50 (stop #~(make-kill-destructor))))))
56 51
57(define llama-swap-service-type 52(define llm-router-service-type
58 (service-type (name 'llama-swap) 53 (service-type (name 'llm-router)
59 (extensions 54 (extensions
60 (list (service-extension account-service-type 55 (list (service-extension account-service-type
61 (const llama-swap-account-service)) 56 (const llm-router-account-service))
62 (service-extension shepherd-root-service-type 57 (service-extension shepherd-root-service-type
63 llama-swap-shepherd-service))) 58 llm-router-shepherd-service)))
64 (description 59 (description
65 "llama-swap is an @code{OpenAI} API compatible server that gives you complete 60 "llm-router is a proxy to OpenAI-compatible and SDAPI-compatible API
66control over how you use your hardware. It automatically swaps to the 61servers.")))
67configuration of your choice for serving a model.")))