main
1# frozen_string_literal: true
2
3require_relative "lib/elelem/llama/version"
4
5Gem::Specification.new do |spec|
6 spec.name = "elelem-llama"
7 spec.version = Elelem::Llama::VERSION
8 spec.authors = ["mo khan"]
9 spec.email = ["mo@mokhan.ca"]
10
11 spec.summary = "A llama.cpp plugin for elelem."
12 spec.description = "A llama.cpp plugin for elelem."
13 spec.homepage = "https://src.mokhan.ca/elelem/llama"
14 spec.license = "MIT"
15 spec.required_ruby_version = ">= 4.0.0"
16 spec.metadata["allowed_push_host"] = "https://rubygems.org"
17 spec.metadata["homepage_uri"] = spec.homepage
18 spec.metadata["source_code_uri"] = spec.homepage
19
20 spec.files = [
21 "LICENSE.txt",
22 "lib/elelem/llama.rb",
23 "lib/elelem/llama/version.rb",
24 "lib/elelem/llama/provider.rb",
25 "exe/elelem-llama",
26 "ext/elelem/llama/elelem.cpp",
27 "ext/elelem/llama/extconf.rb",
28 ]
29 # Only what extconf.rb's cmake build (LLAMA_BUILD_COMMON=ON, tests/docs/
30 # examples/tools/server all OFF) actually needs to configure and compile.
31 # Anchored to the vendor root so this doesn't also strip required nested
32 # dirs with the same name, e.g. src/models/ (per-architecture model code).
33 vendor_exclude = %r{\Avendor/llama\.cpp/(tests|docs|models|examples|tools|\.github|gguf-py|scripts)/}
34 spec.files += Dir["vendor/llama.cpp/**/*"].select do |path|
35 File.file?(path) && path !~ vendor_exclude
36 end
37 spec.extensions = ["ext/elelem/llama/extconf.rb"]
38 spec.bindir = "exe"
39 spec.executables = ["elelem-llama"]
40 spec.require_paths = ["lib"]
41
42 spec.add_dependency "elelem", "~> 0.11"
43 spec.add_dependency "fiddle", "~> 1.1"
44 spec.add_dependency "json", "~> 3.0"
45end