Sha256: afe5f79ec5eeaeaea56c6ec7e62f98a5931c74a11070aa0f3e5fdb991203b761

Contents?: true

Size: 566 Bytes

Versions: 10

Compression:

Stored size: 566 Bytes

Contents

#!/usr/bin/env ruby

require 'time'
require 'term/ansicolor'
include Term::ANSIColor
require 'ollama'
include Ollama

base_url = ENV['OLLAMA_URL'] || 'http://%s' % ENV.fetch('OLLAMA_HOST')
ollama = Client.new(base_url:)
ollama.tags.models.each do |model|
  name, modified_at = model.name, Time.parse(model.modified_at)
  infobar.puts(
    "Updating model #{bold {name}} (last modified at #{modified_at.iso8601}):"
  )
  ollama.pull(name:)
rescue Ollama::Errors::Error => e
  infobar.puts "Caught #{e.class} for model #{bold { model.name }}: #{e} => Continuing."
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ollama-ruby-0.12.1 bin/ollama_update
ollama-ruby-0.12.0 bin/ollama_update
ollama-ruby-0.11.0 bin/ollama_update
ollama-ruby-0.10.0 bin/ollama_update
ollama-ruby-0.9.3 bin/ollama_update
ollama-ruby-0.9.2 bin/ollama_update
ollama-ruby-0.9.1 bin/ollama_update
ollama-ruby-0.9.0 bin/ollama_update
ollama-ruby-0.8.0 bin/ollama_update
ollama-ruby-0.7.0 bin/ollama_update