branch: externals/ellama
commit 111612d5b64ca4bdc7fa5a1b4419427cf0872cef
Author: Sergey Kostyaev <sskosty...@gmail.com>
Commit: Sergey Kostyaev <sskosty...@gmail.com>

    Remove `ellama-ollama-binary` configuration
    
    Removed the unused `ellama-ollama-binary` custom variable and related code 
from
    `README.org`, `ellama.el`, and `ellama.info`. This cleanup simplifies the
    configuration and removes redundant logic. Given that Ollama's API nature 
makes
    it possible, we should consider the feasibility of directly interfacing 
with its
    API instead of relying on a local Ollama installation. This approach would 
be
    particularly beneficial for individuals who host Ollama on a separate 
server, as
    it would eliminate the need for Ollama to be installed on their client 
machine.
    
    Fix #228
---
 README.org  |  3 +--
 ellama.el   | 37 ++++++++++---------------------------
 ellama.info | 53 ++++++++++++++++++++++++++---------------------------
 3 files changed, 37 insertions(+), 56 deletions(-)

diff --git a/README.org b/README.org
index eed1ffa995..d4f84f8212 100644
--- a/README.org
+++ b/README.org
@@ -288,8 +288,7 @@ There are many supported providers: ~ollama~, ~open ai~, 
~vertex~,
   name as key.
 - ~ellama-spinner-enabled~: Enable spinner during text generation.
 - ~ellama-spinner-type~: Spinner type for ellama. Default type is
-~progress-bar~.
-- ~ellama-ollama-binary~: Path to ollama binary.
+  ~progress-bar~.
 - ~ellama-auto-scroll~: If enabled ellama buffer will scroll
   automatically during generation. Disabled by default.
 - ~ellama-fill-paragraphs~: Option to customize ellama paragraphs
diff --git a/ellama.el b/ellama.el
index 2c732d26cf..0c6d9fcc06 100644
--- a/ellama.el
+++ b/ellama.el
@@ -192,10 +192,6 @@ Make reasoning models more useful for many cases."
         (when value
           (ellama-setup-keymap))))
 
-(defcustom ellama-ollama-binary "ollama"
-  "Path to ollama binary."
-  :type 'string)
-
 (defcustom ellama-auto-scroll nil
   "If enabled ellama buffer will scroll automatically during generation."
   :type 'boolean)
@@ -1681,12 +1677,9 @@ ARGS contains keys for fine control.
 :on-done ON-DONE -- ON-DONE a function that's called with
 the full response text when the request completes (with BUFFER current)."
   (interactive "sAsk ellama: ")
-  (let* ((ollama-binary (executable-find ellama-ollama-binary))
-        (providers (append
+  (let* ((providers (append
                     `(("default model" . ellama-provider)
-                      ,(if (and ollama-binary
-                                (file-exists-p ollama-binary))
-                           '("ollama model" . 
(ellama-get-ollama-local-model))))
+                      ("ollama model" . (ellama-get-ollama-local-model)))
                     ellama-providers))
         (variants (mapcar #'car providers))
         (system (plist-get args :system))
@@ -2363,14 +2356,8 @@ Call CALLBACK on result list of strings.  ARGS contains 
keys for fine control.
 
 (defun ellama-get-ollama-model-names ()
   "Get ollama model names."
-  (mapcar (lambda (s)
-           (car (split-string s)))
-         (seq-drop
-          (process-lines
-           (executable-find ellama-ollama-binary)
-           "ls")
-          ;; skip header line
-          1)))
+  (llm-models (or ellama-provider
+                 (make-llm-ollama))))
 
 (defun ellama-embedding-model-p (name)
   "Check if NAME is an embedding model."
@@ -2388,11 +2375,10 @@ Call CALLBACK on result list of strings.  ARGS contains 
keys for fine control.
 (defun ellama-get-first-ollama-chat-model ()
   "Get first available ollama model."
   (declare-function make-llm-ollama "ext:llm-ollama")
-  (when (executable-find ellama-ollama-binary)
-    (require 'llm-ollama)
-    (make-llm-ollama
-     :chat-model
-     (car (ellama-get-ollama-chat-model-names)))))
+  (require 'llm-ollama)
+  (make-llm-ollama
+   :chat-model
+   (car (ellama-get-ollama-chat-model-names))))
 
 (defun ellama-get-ollama-model-name ()
   "Get ollama model name from installed locally."
@@ -2423,12 +2409,9 @@ Call CALLBACK on result list of strings.  ARGS contains 
keys for fine control.
 (defun ellama-provider-select ()
   "Select ellama provider."
   (interactive)
-  (let* ((ollama-binary (executable-find ellama-ollama-binary))
-        (providers (append
+  (let* ((providers (append
                      `(("default model" . ellama-provider)
-                      ,(if (and ollama-binary
-                                (file-exists-p ollama-binary))
-                           '("ollama model" . 
(ellama-get-ollama-local-model))))
+                      ("ollama model" . (ellama-get-ollama-local-model)))
                      ellama-providers))
         (variants (mapcar #'car providers)))
     (setq ellama-provider
diff --git a/ellama.info b/ellama.info
index 9a305ef574..fa91e3586d 100644
--- a/ellama.info
+++ b/ellama.info
@@ -399,8 +399,7 @@ There are many supported providers: ‘ollama’, ‘open ai’, 
‘vertex’,
      name as key.
    • ‘ellama-spinner-enabled’: Enable spinner during text generation.
    • ‘ellama-spinner-type’: Spinner type for ellama.  Default type is
-‘progress-bar’.
-   • ‘ellama-ollama-binary’: Path to ollama binary.
+     ‘progress-bar’.
    • ‘ellama-auto-scroll’: If enabled ellama buffer will scroll
      automatically during generation.  Disabled by default.
    • ‘ellama-fill-paragraphs’: Option to customize ellama paragraphs
@@ -1416,31 +1415,31 @@ Node: Installation3613
 Node: Commands8621
 Node: Keymap14965
 Node: Configuration17798
-Node: Context Management23139
-Node: Transient Menus for Context Management24047
-Node: Managing the Context25661
-Node: Considerations26436
-Node: Minor modes27029
-Node: ellama-context-header-line-mode29017
-Node: ellama-context-header-line-global-mode29842
-Node: ellama-context-mode-line-mode30562
-Node: ellama-context-mode-line-global-mode31410
-Node: Ellama Session Header Line Mode32114
-Node: Enabling and Disabling32683
-Node: Customization33130
-Node: Ellama Session Mode Line Mode33418
-Node: Enabling and Disabling (1)34003
-Node: Customization (1)34450
-Node: Using Blueprints34744
-Node: Key Components of Ellama Blueprints35363
-Node: Creating and Managing Blueprints35970
-Node: Variable Management36951
-Node: Keymap and Mode37420
-Node: Transient Menus38356
-Node: Running Blueprints programmatically38902
-Node: Acknowledgments39489
-Node: Contributions40202
-Node: GNU Free Documentation License40586
+Node: Context Management23086
+Node: Transient Menus for Context Management23994
+Node: Managing the Context25608
+Node: Considerations26383
+Node: Minor modes26976
+Node: ellama-context-header-line-mode28964
+Node: ellama-context-header-line-global-mode29789
+Node: ellama-context-mode-line-mode30509
+Node: ellama-context-mode-line-global-mode31357
+Node: Ellama Session Header Line Mode32061
+Node: Enabling and Disabling32630
+Node: Customization33077
+Node: Ellama Session Mode Line Mode33365
+Node: Enabling and Disabling (1)33950
+Node: Customization (1)34397
+Node: Using Blueprints34691
+Node: Key Components of Ellama Blueprints35310
+Node: Creating and Managing Blueprints35917
+Node: Variable Management36898
+Node: Keymap and Mode37367
+Node: Transient Menus38303
+Node: Running Blueprints programmatically38849
+Node: Acknowledgments39436
+Node: Contributions40149
+Node: GNU Free Documentation License40533
 
 End Tag Table
 

Reply via email to