ollama-find 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/README.md +7 -3
- data/lib/ollama-find/lookup_gguf_path.rb +7 -5
- data/lib/ollama-find/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea4d5f03bc4a42566e43feb92824aae5ecdfc12e1984b10cd9d5e6692ff58544
|
4
|
+
data.tar.gz: 79ad502e0e8976f4ceb47eb1c7b16f97abd9a8a9b541f491b314e674937a518b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e61d31a97e4b6a7ec7e50ba27b1aa494d7533812fd4070b0a9b4b8f064b21891419a88c4f87b505dd456bfebdd0b4722e9a8069beb574f5a3fb748a533df30d
|
7
|
+
data.tar.gz: dc4d1d4a7e21441aadc987277947a25cf6ba349b313d36ed43e389ad8e4a6556c9e1820bc31d8880dc6549a756a4cda9f4cac19522cd3be0363990205400e1dc
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.4.2
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Ollama::Find
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/ollama-find)
|
4
|
+
[](https://github.com/TheNotary/tool-ruby-ollama-find/actions/workflows/test.yml)
|
5
|
+
|
6
|
+
This is a CLI tool that allows you to quickly generate a path to a `.gguf` file that's been pulled via Ollama.
|
4
7
|
|
5
8
|
|
6
9
|
## Installation
|
@@ -16,8 +19,9 @@ This guide assumes you've already installed [Ollama](https://ollama.com/download
|
|
16
19
|
|
17
20
|
```bash
|
18
21
|
# Pull a model to test with
|
19
|
-
ollama pull
|
22
|
+
$ ollama pull llama3
|
20
23
|
|
21
24
|
# Get the path to that model
|
22
|
-
ollama-find
|
25
|
+
$ ollama-find llama3
|
26
|
+
~/.ollama/models/blobs/sha256-e5f23238e18e103a64bb1027412f829b4d546f17aed3b42b4401e0dbfa11537c
|
23
27
|
```
|
@@ -4,7 +4,7 @@ require 'json'
|
|
4
4
|
|
5
5
|
module Ollama
|
6
6
|
module Find
|
7
|
-
CLEAN_MODEL_DIR = "
|
7
|
+
CLEAN_MODEL_DIR = File.join("~", ".ollama", "models")
|
8
8
|
MODEL_DIR = File.expand_path(CLEAN_MODEL_DIR)
|
9
9
|
|
10
10
|
# Retrieves the file path to the GGUF model based on a given model name and optional tag.
|
@@ -33,15 +33,16 @@ module Ollama
|
|
33
33
|
begin
|
34
34
|
manifest = JSON.parse(read_manifest(path_to_manifest))
|
35
35
|
rescue JSON::ParserError
|
36
|
-
return "Error: Unable to parse manifest at #{path_to_manifest}"
|
36
|
+
return "Error: Unable to parse manifest at #{clean_path(path_to_manifest)}"
|
37
37
|
end
|
38
38
|
|
39
39
|
begin
|
40
40
|
digest = extract_model_digest(manifest)
|
41
41
|
rescue
|
42
|
-
return "Error: Unable to extract digest from manifest at #{path_to_manifest} for model_name #{model_name}"
|
42
|
+
return "Error: Unable to extract digest from manifest at #{clean_path(path_to_manifest)} for model_name #{model_name}"
|
43
43
|
end
|
44
44
|
|
45
|
+
return File.join(MODEL_DIR, "blobs", digest) if Gem.win_platform?
|
45
46
|
File.join(CLEAN_MODEL_DIR, "blobs", digest)
|
46
47
|
end
|
47
48
|
|
@@ -59,6 +60,7 @@ module Ollama
|
|
59
60
|
end
|
60
61
|
|
61
62
|
def self.clean_path(absolute_path)
|
63
|
+
return absolute_path if Gem.win_platform?
|
62
64
|
absolute_path.sub(MODEL_DIR, CLEAN_MODEL_DIR)
|
63
65
|
end
|
64
66
|
|
@@ -74,9 +76,9 @@ module Ollama
|
|
74
76
|
end
|
75
77
|
if model_name.split("/").count > 1
|
76
78
|
subcatalog = model_name.split("/").first
|
77
|
-
return ["registry.ollama.ai
|
79
|
+
return [File.join("registry.ollama.ai", subcatalog), model_name.sub("#{subcatalog}/", "")]
|
78
80
|
end
|
79
|
-
["registry.ollama.ai
|
81
|
+
[File.join("registry.ollama.ai", "library"), model_name]
|
80
82
|
end
|
81
83
|
|
82
84
|
def self.get_private_registry_model_name_and_registry(model_name)
|
data/lib/ollama-find/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ollama-find
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TheNotary
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03
|
10
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bundler
|
@@ -72,6 +72,7 @@ executables:
|
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
|
+
- ".ruby-version"
|
75
76
|
- CODE_OF_CONDUCT.md
|
76
77
|
- README.md
|
77
78
|
- Rakefile
|