last_llm 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/last_llm/install/install_generator.rb +25 -0
- data/lib/generators/last_llm/install/templates/README.md +20 -0
- data/lib/generators/last_llm/install/templates/initializer.rb +28 -0
- data/lib/generators/last_llm/install/templates/last_llm.yml +29 -0
- data/lib/last_llm/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbbca19ed3e3a2df1b0719317c35219d19559ffe0747336546c727eb4aafba58
|
4
|
+
data.tar.gz: a8e24e555e72ee106e68f2846a9449a9dd45c9ed656539d34185dd731e8304a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f59d7412a949b1809d1481891f61738ec5e10fa1d275ea7af7f12387c705437801982ad0841f9fef3d2d9b9dd426d770d47da31b4fae6bc0f49e85cfd78e5eef
|
7
|
+
data.tar.gz: 406c2dca198e6659d281a03754cca5c5ff5757669bb6edc64fa564144ea6aa6ee770530faad5541df7be641e0152285f0759f3176a096be82c59980a1cb80b59
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators'
|
4
|
+
|
5
|
+
module LastLLM
|
6
|
+
module Generators
|
7
|
+
class InstallGenerator < Rails::Generators::Base
|
8
|
+
source_root File.expand_path('templates', __dir__)
|
9
|
+
|
10
|
+
desc 'Creates a LastLLM configuration file and initializer'
|
11
|
+
|
12
|
+
def create_config_file
|
13
|
+
template 'last_llm.yml', 'config/last_llm.yml'
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_initializer
|
17
|
+
template 'initializer.rb', 'config/initializers/last_llm.rb'
|
18
|
+
end
|
19
|
+
|
20
|
+
def show_readme
|
21
|
+
readme 'README.md'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
LastLLM Installation
|
2
|
+
===================
|
3
|
+
|
4
|
+
LastLLM has been installed. Here's what was created:
|
5
|
+
|
6
|
+
* config/last_llm.yml - Main configuration file
|
7
|
+
* config/initializers/last_llm.rb - Rails initializer
|
8
|
+
|
9
|
+
Next steps:
|
10
|
+
|
11
|
+
1. Edit config/last_llm.yml and add your API keys
|
12
|
+
2. Set up environment variables for your API keys
|
13
|
+
3. Test the installation:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
client = LastLLM.client
|
17
|
+
response = client.generate_text("Hello, world!")
|
18
|
+
```
|
19
|
+
|
20
|
+
For more information, visit: https://github.com/joemocha/last_llm
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Configure LastLLM
|
4
|
+
LastLLM.configure do |config|
|
5
|
+
# Load configuration from config/last_llm.yml
|
6
|
+
config_file = Rails.root.join('config', 'last_llm.yml')
|
7
|
+
if File.exist?(config_file)
|
8
|
+
yaml_config = YAML.safe_load_file(config_file, symbolize_names: true)
|
9
|
+
|
10
|
+
# Set default provider
|
11
|
+
config.default_provider = yaml_config[:default_provider].to_sym if yaml_config[:default_provider]
|
12
|
+
|
13
|
+
# Set default model
|
14
|
+
config.default_model = yaml_config[:default_model] if yaml_config[:default_model]
|
15
|
+
|
16
|
+
# Configure providers
|
17
|
+
yaml_config[:providers]&.each do |provider, settings|
|
18
|
+
settings.each do |key, value|
|
19
|
+
config.set_provider_config(provider, key, value)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Configure global settings
|
24
|
+
yaml_config[:globals]&.each do |key, value|
|
25
|
+
config.set_global(key.to_sym, value)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# LastLLM Configuration
|
2
|
+
|
3
|
+
# Default provider to use (options: :openai, :anthropic, :google_gemini, :deepseek, :ollama)
|
4
|
+
default_provider: :openai
|
5
|
+
|
6
|
+
# Default model to use (provider-specific)
|
7
|
+
default_model: gpt-3.5-turbo
|
8
|
+
|
9
|
+
# Global settings
|
10
|
+
globals:
|
11
|
+
temperature: 0.7
|
12
|
+
max_tokens: 1000
|
13
|
+
|
14
|
+
# Provider-specific configurations
|
15
|
+
providers:
|
16
|
+
openai:
|
17
|
+
api_key: <%= ENV['OPENAI_API_KEY'] %>
|
18
|
+
|
19
|
+
anthropic:
|
20
|
+
api_key: <%= ENV['ANTHROPIC_API_KEY'] %>
|
21
|
+
|
22
|
+
google_gemini:
|
23
|
+
api_key: <%= ENV['GOOGLE_GEMINI_API_KEY'] %>
|
24
|
+
|
25
|
+
deepseek:
|
26
|
+
api_key: <%= ENV['DEEPSEEK_API_KEY'] %>
|
27
|
+
|
28
|
+
ollama:
|
29
|
+
host: http://localhost:11434
|
data/lib/last_llm/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: last_llm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Obukwelu
|
@@ -101,6 +101,10 @@ extensions: []
|
|
101
101
|
extra_rdoc_files: []
|
102
102
|
files:
|
103
103
|
- README.md
|
104
|
+
- lib/generators/last_llm/install/install_generator.rb
|
105
|
+
- lib/generators/last_llm/install/templates/README.md
|
106
|
+
- lib/generators/last_llm/install/templates/initializer.rb
|
107
|
+
- lib/generators/last_llm/install/templates/last_llm.yml
|
104
108
|
- lib/last_llm.rb
|
105
109
|
- lib/last_llm/client.rb
|
106
110
|
- lib/last_llm/completion.rb
|