fix(chaos): finalized absolute tangle paths via concat and INSTALL_DIR
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#+PROPERTY: header-args:lisp :tangle (concat (getenv "INSTALL_DIR") "/skills/org-skill-llama-backend.lisp" (expand-file-name ""))
|
||||
#+PROPERTY: header-args:lisp :tangle (concat (identity (getenv "INSTALL_DIR")) "/skills/org-skill-llama-backend.lisp")" )
|
||||
:PROPERTIES:
|
||||
:ID: llama-backend-skill
|
||||
:CREATED: [2026-04-17 Fri 20:00]
|
||||
@@ -15,7 +15,7 @@ The *Llama.cpp Backend* allows the OpenCortex to use local, air-gapped inference
|
||||
This skill acts as a proxy between the OpenCortex kernel and the Lisp-agnostic `llama.cpp` REST API. It implements the standard backend signature required by `register-probabilistic-backend`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
- Endpoint: `(getenv "LLAMACPP_ENDPOINT")` (e.g., "http://10.10.10.x:8080")
|
||||
- Endpoint: `(getenv "LLAMACPP_ENDPOINT` (e.g., "http://10.10.10.x:8080
|
||||
- Method: `POST /completion`
|
||||
- Response: JSON (parsed into Lisp)
|
||||
|
||||
@@ -28,22 +28,22 @@ This skill acts as a proxy between the OpenCortex kernel and the Lisp-agnostic `
|
||||
|
||||
** The Inference Engine (llama-inference)
|
||||
#+begin_src lisp
|
||||
(defun llama-inference (prompt system-prompt &key (model "local-model"))
|
||||
(defun llama-inference (prompt system-prompt &key (model "local-model)
|
||||
"Sends a completion request to the local llama.cpp server."
|
||||
(let ((endpoint (getenv "LLAMACPP_ENDPOINT")))
|
||||
(let ((endpoint (getenv "LLAMACPP_ENDPOINT))
|
||||
(unless endpoint
|
||||
(harness-log "LLAMA ERROR: LLAMACPP_ENDPOINT not set in environment.")
|
||||
(return-from llama-inference (list :error "LLAMACPP_ENDPOINT_MISSING")))
|
||||
(harness-log "LLAMA ERROR: LLAMACPP_ENDPOINT not set in environment.
|
||||
(return-from llama-inference (list :error "LLAMACPP_ENDPOINT_MISSING))
|
||||
|
||||
(handler-case
|
||||
(let* ((full-prompt (format nil "System: ~a~%User: ~a~%Assistant:" system-prompt prompt))
|
||||
(payload (cl-json:encode-json-to-string
|
||||
`((:prompt . ,full-prompt)
|
||||
(:n_predict . 1024)
|
||||
(:stop . ("User:" "System:")))))
|
||||
(:stop . ("User:" "System:))))
|
||||
(response (dex:post (format nil "~a/completion" endpoint)
|
||||
:content payload
|
||||
:headers '(("Content-Type" . "application/json"))))
|
||||
:headers '(("Content-Type" . "application/json)))
|
||||
(data (cl-json:decode-json-from-string response)))
|
||||
(cdr (assoc :content data)))
|
||||
(error (c)
|
||||
@@ -55,7 +55,7 @@ This skill acts as a proxy between the OpenCortex kernel and the Lisp-agnostic `
|
||||
#+begin_src lisp
|
||||
(progn
|
||||
(register-probabilistic-backend :llama #'llama-inference)
|
||||
(harness-log "LLAMA: Local backend registered and active."))
|
||||
(harness-log "LLAMA: Local backend registered and active.)
|
||||
|
||||
(defskill :skill-llama-backend
|
||||
:priority 50
|
||||
|
||||
Reference in New Issue
Block a user