Project

rager

0.0
No release in over 3 years
Build continuously improving generative workflows.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 1.14
~> 0.5.12028
~> 2.7
 Project Readme

rager_rb

gem publish test lint docs

Build continuously improving generative workflows.

Logging

Why yet another library? The main reason is to have an out-of-the-box logging server that records workflows and outcomes to use in few-shot prompting and fine-tuning.

Providers

Modalities that take a URL parameter (chat, embedding, rerank) support compatible services, allowing you to use alternative providers that support the interface.

Feature Providers
Chat openai
Embedding openai
Image generation replicate
3D mesh generation replicate
Reranking cohere
Search jina
Templating erb,mustache

Installation

Add this line to your application's Gemfile:

gem "rager", "~> 0.8.0"

Or use it in a standalone script (requires OPENAI_API_KEY set):

require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "async-http", "~> 0.88.0"
  gem "rager", "~> 0.8.0"
end

require "rager"

Rager.configure do |config|
  config.http_adapter = Rager::Http::Adapters::AsyncHttp.new
end

PROMPT = ARGV[0] || "Ruby programming"

Async do
  ctx = Rager::Context.new
  prompt = ctx.template("Tell me about the history of <%= topic %>", {topic: PROMPT})
  chat = ctx.chat(prompt, stream: true)
  chat.stream.each { |d| print d.content }
end

License

MIT