
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Durable-LLM is a Ruby gem providing a unified interface for interacting with multiple Large Language Model APIs. It simplifies the integration of AI capabilities into Ruby applications by offering a consistent way to access various LLM providers.
Add this line to your application's Gemfile:
gem 'durable-llm'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install durable-llm
Here's a basic example of how to use Durable-LLM:
require 'durable-llm'
client = Durable::Llm::Client.new(:openai, api_key: 'your-api-key')
response = client.completion(
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: 'Hello, how are you?' }]
)
puts response.choices.first.message.content
You can configure Durable-LLM globally or on a per-request basis:
Durable::Llm.configure do |config|
config.default_provider = :openai
config.openai.api_key = 'your-openai-api-key'
config.anthropic.api_key = 'your-anthropic-api-key'
# Add other provider configurations as needed
end
Durable-LLM provides a unified error handling system:
begin
response = client.completion(model: 'gpt-3.5-turbo', messages: [...])
rescue Durable::Llm::APIError => e
puts "API Error: #{e.message}"
rescue Durable::Llm::RateLimitError => e
puts "Rate Limit Exceeded: #{e.message}"
end
Thank you to the lite-llm and llm.datasette.io projects for their hard work, which was invaluable to this project. The dllm command line tool is patterned after the llm tool, though not as full-featured (yet).
The streaming jsonl code is from the ruby-openai repo; many thanks for their hard work.
Bug reports and pull requests are welcome on GitHub at https://github.com/durableprogramming/durable-llm.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that durable-llm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.