Project

llamafile

0.0
The project is in a healthy, maintained state
Wraps a locally installed llamafile in an a pure ruby object.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

Why?

Because sometimes local llamafile interactions on local hardware with local data is the only option.

BEFORE

  1. wget -O llamafile
  2. chmod +x llamafile
  3. sudo mv lamafile /usr/bin/llama

Installation

bundle

bundle add llamafile

gems

gem install llamafile

Usage

module

Pass a raw string to the module and

Llamafile.llama("What is the meaning of life?") => { input: "What is the meaning of life?", output: "42." }

include

class X
	include Llamafile
	def initialize k
		@id = k
		@db = My.data[k]
	end
	def what_is_my_name?
		@prompt = %[My name is #{@db[:name]}.]
		h =	llama(%[#{@prompt}  What is my name?])
		return h[:output]
	end
end