
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
🚧 This gem is still under development 🚧
Install the gem and add to the application"s Gemfile by executing:
$ bundle add replicate
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install replicate
You can configure the gem by calling the #configure
method on the ReplicateClient
module. The method accepts a block with the configuration options.
ReplicateClient.configure do |config|
config.access_token = ENV["REPLICATE_ACCESS_TOKEN"] # Required
config.uri_base = "https://replicate.app/api/v1" # Optional
config.request_timeout = 5 # Optional (default: 120)
config.webhook_url = "https://example.com/replicate/webhook" # Optional
end
model = ReplicateClient::Model.find("stability-ai/sdxl")
model = ReplicateClient::Model.find_by(owner: "stability-ai", name: "sdxl")
model = ReplicateClient::Model.find_by(owner: "stability-ai", name: "sdxl", version_id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
version = ReplicateClient::Model::Version.find_by(owner: "stability-ai", name: "sdxl", version_id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
model = ReplicateClient::Model.find_by(owner: "stability-ai", name: "sdxl", version_id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
version = model.version
model = ReplicateClient::Model.find("stability-ai/sdxl")
version = model.latest_version
model = ReplicateClient::Model.find("stability-ai/sdxl")
versions = model.versions
ReplicateClient::Model.auto_paging_each do |model|
puts model.name
end
version = ReplicateClient::Model::Version.find_by(owner: "stability-ai", name: "sdxl", version_id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
prediction = version.create_prediction!(input: { my: "input" })
prediction = version.create_prediction!(input: { my: "input" }, webhook_url: "https://example.com/replicate/webhook")
prediction = version.create_prediction!(input: { my: "input" }, webhook_url: "https://example.com/replicate/webhook", webhook_events_filter: ["start", "completed"])
prediction = ReplicateClient::Prediction.create!(version: version, input: { my: "input" })
prediction = ReplicateClient::Prediction.create!(version: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc", input: { my: "input" })
deployment = ReplicateClient::Deployment.find("851-labs/my-deployment")
prediction = deployment.create_prediction!(input: { my: "input" })
model = ReplicateClient::Model.find("stability-ai/sdxl")
prediction = model.create_prediction!(input: { my: "input" })
prediction = ReplicateClient::Prediction.create_for_official_model!(model: "stability-ai/sdxl", input: { my: "input" })
prediction = ReplicateClient::Prediction.find("7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
prediction = ReplicateClient::Prediction.find_by(id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
prediction = ReplicateClient::Prediction.find_by!(id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
model = ReplicateClient::Model.find("stability-ai/sdxl")
model.reload!
version = ReplicateClient::Model::Version.find_by(owner: "stability-ai", name: "sdxl", version_id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
version.reload!
prediction = ReplicateClient::Prediction.find("7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
prediction.reload!
model = ReplicateClient::Model.find("stability-ai/sdxl")
model.delete!
hardware = ReplicateClient::Hardware.all
deployment = ReplicateClient::Deployment.create!(name: "851-deployment", model: "stability-ai/sdxl", hardware: "gpu-t4", min_instances: 1, max_instances: 1)
model = ReplicateClient::Model.find("stability-ai/sdxl")
deployment = ReplicateClient::Deployment.create!(name: "851-deployment", model: model, hardware: "gpu-t4", min_instances: 1, max_instances: 1)
hardware = ReplicateClient::Hardware.all.first
deployment = ReplicateClient::Deployment.create!(name: "851-deployment", model: model, hardware: hardware, min_instances: 1, max_instances: 1)
deployment = ReplicateClient::Deployment.find("851-labs/my-deployment")
deployment = ReplicateClient::Deployment.find_by(owner: "851-labs", name: "my-deployment")
deployment = ReplicateClient::Deployment.find_by!(owner: "851-labs", name: "my-deployment")
ReplicateClient::Deployment.auto_paging_each do |deployment|
puts deployment.name
end
training = ReplicateClient::Training.create!(owner: "851-labs", name: "my-training", version: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc", destination: "851-labs/my-new-model", input: {})
sdxl = ReplicateClient::Model::Version.find_by(owner: "stability-ai", name: "sdxl", version_id: "7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc")
destination_model = ReplicateClient::Model.find("851-labs/my-new-model")
training = ReplicateClient::Training.create!(owner: "851-labs", name: "my-training", version: version, destination: destination_model, input: {})
sdxl = ReplicateClient::Model.find("stability-ai/sdxl")
destination_model = ReplicateClient::Model.find("851-labs/my-new-model")
training = ReplicateClient::Training.create_for_model!(model: sdxl, destination: destination_model, input: {})
training = ReplicateClient::Training.find("b3kgfb2y9nrm00chdnkaam2dvz")
ReplicateClient::Training.auto_paging_each do |training|
puts training.name
end
training = ReplicateClient::Training.find("b3kgfb2y9nrm00chdnkaam2dvz")
training.cancel!
Official models will not have vesions. The version id will be nil.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
FAQs
Unknown package
We found that replicate-client 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.