Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Bug report
description: Report a reproducible bug or unexpected behavior
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for reporting a bug! Please provide as much detail as possible.

- type: input
id: gem_version
attributes:
label: Gem Version
placeholder: e.g., 0.2.1
validations:
required: true

- type: textarea
id: description
attributes:
label: What happened?
description: Describe the unexpected behavior or error message
validations:
required: true

- type: textarea
id: steps
attributes:
label: Steps to Reproduce
description: Provide a minimal script or code snippet to reproduce the issue
placeholder: |
1. Call method `X` with parameter `Y`
2. Observe error message `Z`
validations:
required: true

- type: textarea
id: expected
attributes:
label: What did you expect to happen?
description: What should the correct behavior be?

- type: textarea
id: environment
attributes:
label: Environment
description: Ruby version, OS, and any other relevant info
placeholder: |
Ruby version: 3.2.2
OS: macOS 14.0
Bundler version: 2.4.0

- type: checkboxes
id: confirmation
attributes:
label: Before submitting
options:
- label: I've updated to the latest version of the gem
required: true
- label: I've read the README and documentation
required: true
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true

- name: Build and Push Gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
run: |
mkdir -p ~/.gem
echo -e "---\n:rubygems_api_key: $GEM_HOST_API_KEY" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
gem build *.gemspec
gem push *.gem
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1', '3.2', '3.3', '3.4']

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Run tests
run: bundle exec rspec
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
plugins:
- rubocop-rake
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.1
NewCops: enable
SuggestExtensions: false

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.0.0.rc3 (2025-04-06)

- Added rspec test suite with vcr, covering current functionality:
- Chat and Multi-turn conversation tests
- Streaming response tests
- Tools calling functionality tests
- Embedding generation tests
- Image generation tests
- Added GitHub workflows for:
- CI testing across Ruby versions 3.1, 3.2, 3.3, and 3.4
- Automated gem release process
- Issue templates for bug reports

## 1.0.0.rc2 (2025-03-16)

- Minor improvements to README documentation and fixes to GitHub repository links.
Expand Down
22 changes: 14 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Include gem dependencies from litellm.gemspec
gemspec

gem "byebug", "~> 11.1.3"
gem "dotenv", "~> 2.8.1"
gem "rake", "~> 13.2"
gem "rspec", "~> 3.13"
gem "rubocop", "~> 1.73.1"
gem "vcr", "~> 6.1.0"
gem "webmock", "~> 3.24.0"
group :development do
gem "activesupport", "< 8.0"
gem "bundler", ">= 2.0"
gem "dotenv"
gem "rake", ">= 13.0"
gem "rspec", "~> 3.12"
gem "rubocop", ">= 1.0"
gem "rubocop-rake"
gem "rubocop-rspec"
gem "vcr"
gem "webmock"
end
106 changes: 71 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,78 +1,111 @@
PATH
remote: .
specs:
litellm (1.0.0.rc1)
litellm (1.0.0.rc3)
event_stream_parser (>= 0.3.0, < 2.0.0)
faraday (>= 1)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
ast (2.4.3)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
byebug (11.1.3)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
crack (1.0.0)
bigdecimal
rexml
diff-lcs (1.5.1)
dotenv (2.8.1)
diff-lcs (1.6.1)
dotenv (3.1.7)
drb (2.2.1)
event_stream_parser (1.0.0)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
faraday (2.12.2)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.3.0)
net-http
hashdiff (1.1.1)
json (2.9.1)
faraday-net_http (3.4.0)
net-http (>= 0.5.0)
hashdiff (1.1.2)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.10.2)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
logger (1.6.6)
net-http (0.5.0)
logger (1.7.0)
minitest (5.25.5)
net-http (0.6.0)
uri
parallel (1.26.3)
parser (3.3.6.0)
parser (3.3.7.4)
ast (~> 2.4.1)
racc
prism (1.4.0)
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rexml (3.3.9)
rexml (3.4.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.73.2)
rspec-support (3.13.2)
rubocop (1.75.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.1)
parser (>= 3.3.1.0)
rubocop-ast (1.44.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-rake (0.7.1)
lint_roller (~> 1.1)
rubocop (>= 1.72.1)
rubocop-rspec (3.5.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
ruby-progressbar (1.13.0)
unicode-display_width (2.6.0)
uri (1.0.2)
vcr (6.1.0)
webmock (3.24.0)
securerandom (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
vcr (6.3.1)
base64
webmock (3.25.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -82,14 +115,17 @@ PLATFORMS
ruby

DEPENDENCIES
byebug (~> 11.1.3)
dotenv (~> 2.8.1)
activesupport (< 8.0)
bundler (>= 2.0)
dotenv
litellm!
rake (~> 13.2)
rspec (~> 3.13)
rubocop (~> 1.73.1)
vcr (~> 6.1.0)
webmock (~> 3.24.0)
rake (>= 13.0)
rspec (~> 3.12)
rubocop (>= 1.0)
rubocop-rake
rubocop-rspec
vcr
webmock

BUNDLED WITH
2.6.2
2.6.5
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# LiteLLM Ruby Client

<a href="https://badge.fury.io/rb/litellm"><img src="https://badge.fury.io/rb/litellm.svg" alt="Gem Version" height="18"></a>

A Ruby client for [LiteLLM](https://docs.litellm.ai/docs) with support for completions, embeddings, and image generation.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0.rc2
1.0.0.rc3
16 changes: 9 additions & 7 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "openai"
require "litellm"
require "dotenv/load"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
require "irb"

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
LiteLLM.configure do |config|
config.base_url = "http://localhost:8000"
config.debug = true
config.model = "gpt-4o"
end

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/start_litellm_server
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"

# Change to the test_server directory and run the start script
cd "$PROJECT_ROOT/test_server" && ./start_litellm.sh
Loading
Loading