Commit ed6162f

mo khan <mo@mokhan.ca>
2026-09-06 22:26:09
chore: add standalone repo scaffolding
1 parent 2b53300
bin/compile
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+[ -n "$DEBUG" ] && set -x
+
+cd "$(dirname "$0")/.."
+
+bundle exec rake compile
bin/console
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+# frozen_string_literal: true
+
+require "bundler/setup"
+require "elelem/llama"
+require "irb"
+
+IRB.start(__FILE__)
bin/setup
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+[ -n "$DEBUG" ] && set -x
+
+git submodule update --init --recursive
+bundle install
+
+GGUF_MODEL_DIR="$HOME/.agents/models"
+GGUF_MODEL_URL="https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/resolve/main/Qwen3.8-27B-UD-Q4_K_XL.gguf"
+GGUF_MODEL_PATH="$GGUF_MODEL_DIR/Qwen3.8-27B-UD-Q4_K_XL.gguf"
+
+if [ ! -f "$GGUF_MODEL_PATH" ]; then
+  mkdir -p "$GGUF_MODEL_DIR"
+  curl -fL --progress-bar -o "$GGUF_MODEL_PATH.part" "$GGUF_MODEL_URL"
+  mv "$GGUF_MODEL_PATH.part" "$GGUF_MODEL_PATH"
+fi
vendor/llama.cpp
@@ -0,0 +1,1 @@
+Subproject commit 6a1a922d269908a29cbd4b49c27e6a8e7fd10fae
.gitignore
@@ -0,0 +1,15 @@
+/.bundle/
+/.yardoc
+/_yardoc/
+/coverage/
+/pkg/
+/spec/reports/
+/tmp/
+*.bundle
+*.so
+*.o
+*.a
+*.gem
+/ext/elelem/llama/native
+/ext/elelem/llama/build/
+/ext/elelem/llama/Makefile
.gitmodules
@@ -0,0 +1,3 @@
+[submodule "vendor/llama.cpp"]
+	path = vendor/llama.cpp
+	url = https://github.com/ggml-org/llama.cpp
elelem-llama.gemspec
@@ -10,13 +10,12 @@ Gem::Specification.new do |spec|
 
   spec.summary = "A llama.cpp plugin for elelem."
   spec.description = "A llama.cpp plugin for elelem."
-  spec.homepage = "https://src.mokhan.ca/xlgmokha/elelem"
+  spec.homepage = "https://src.mokhan.ca/elelem/llama"
   spec.license = "MIT"
   spec.required_ruby_version = ">= 4.0.0"
-  spec.required_rubygems_version = ">= 4.0.0"
   spec.metadata["allowed_push_host"] = "https://rubygems.org"
   spec.metadata["homepage_uri"] = spec.homepage
-  spec.metadata["source_code_uri"] = "https://git.mokhan.ca/xlgmokha/elelem.git"
+  spec.metadata["source_code_uri"] = spec.homepage
 
   spec.files = [
     "LICENSE.txt",
@@ -28,8 +27,6 @@ Gem::Specification.new do |spec|
     "ext/elelem/llama/elelem.cpp",
     "ext/elelem/llama/extconf.rb",
   ]
-  # Vendored llama.cpp source (git submodule) is compiled at install time by the
-  # extension below, so it must ship in the gem.
   spec.files += Dir["vendor/llama.cpp/**/*"].select { |path| File.file?(path) }
   spec.extensions = ["ext/elelem/llama/extconf.rb"]
   spec.bindir = "exe"
Gemfile
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+source "https://rubygems.org"
+
+gemspec name: "elelem-llama"
+
+gem "irb"
+gem "rake", "~> 13.0"
LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2026 mo khan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Rakefile
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+require "bundler/gem_tasks"
+
+desc "Build the in-process llama.cpp extension (the same build `gem install` runs)"
+task :compile do
+  ruby "ext/elelem/llama/extconf.rb"
+end
+
+task default: %i[]