llm_conductor 1.8.0 → 1.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac4b318b4227e3f089f42d471d51a1d7fefc9c54d080c30bbb2e748039ee4ae0
4
- data.tar.gz: c21eb439aed4fc671fde4dc30c06c12f0853a5f99ba29d47c3bd3b389f5b27c0
3
+ metadata.gz: 8a13bccd45a0d886de6bc88a531724a2e929912d21564f5c50296c000c28476a
4
+ data.tar.gz: 1838b42538d448dc2373b1e7e9180b92b1f97fe87dfd8b50b18a164ac992ffae
5
5
  SHA512:
6
- metadata.gz: 918613d702e3918ae5651ec8aefab34126a36a17c0be75549a2227fb9a3e6b7392c245a7d96a2d15df6e76996e871c66c1572cb1f061d5bef1c96fe1e31ec8e4
7
- data.tar.gz: e4b356669ce32103a8a264c66574edf7f0819379240798d0d91b0cd29c623e512cd6776eb4d5bcf421d6fb8cb30bb2467cc188154910928a8aa6b16adc017d76
6
+ metadata.gz: aeac7323ebde9d6327f9e536876d42f951d5e042f37888f6d0cb0dc64aaa50fd820c94cf4788a6ebde8b9e27423d67872f99a87c6ff6400f910cb07fbf37cfbc
7
+ data.tar.gz: 20dcb4c95317a32eaa033bbf0dadfdfa3aef5934818fbc491fd13b9e467edbe5a2b332d3234ee9f7b7181900a0a35294d356417c759c5cb736a476592ac670cf
data/README.md CHANGED
@@ -10,6 +10,7 @@ A unified Ruby interface for multiple Language Model providers from [Ekohe](http
10
10
  - 🔧 **Custom Parameters** - Fine-tune with temperature, top_p, and more
11
11
  - 💰 **Cost Tracking** - Automatic token counting and cost estimation
12
12
  - ⚡ **Smart Configuration** - Environment variables or code-based setup
13
+ - 📊 **Model Evaluation** - Compare models/vendors on cost, latency, tokens & LLM-judged quality (opt-in)
13
14
 
14
15
  ## Installation
15
16
 
@@ -318,6 +319,7 @@ See [`examples/model_eval_usage.rb`](examples/model_eval_usage.rb) for a complet
318
319
 
319
320
  - **[Custom Parameters Guide](docs/custom-parameters.md)** - Temperature, top_p, and more
320
321
  - **[Vision Support Guide](docs/vision-support.md)** - Using images with LLMs
322
+ - **[Model Evaluation](#model-evaluation-opt-in)** - Compare models on cost, latency & LLM-judged quality
321
323
  - **[Examples](examples/)** - Working code examples for all providers
322
324
 
323
325
  ## Examples
@@ -2,20 +2,35 @@
2
2
 
3
3
  module LlmConductor
4
4
  module Clients
5
- # Groq client implementation for accessing Groq models via Groq API
5
+ # Groq client implementation for accessing Groq models via Groq API.
6
+ #
7
+ # The groq gem defaults to a 1024-token output cap and a 5s request timeout
8
+ # (Groq::Configuration::DEFAULT_MAX_TOKENS / DEFAULT_REQUEST_TIMEOUT), which
9
+ # silently truncate longer structured outputs mid-response. We raise both to
10
+ # sane defaults and honor per-call +params+ (e.g. max_tokens, temperature).
6
11
  class GroqClient < BaseClient
12
+ DEFAULT_MAX_TOKENS = 8192
13
+ DEFAULT_REQUEST_TIMEOUT = 120
14
+
7
15
  private
8
16
 
9
17
  def generate_content(prompt)
10
18
  # Groq::Client.chat expects messages as positional arg, not keyword arg
11
19
  messages = [{ role: 'user', content: prompt }]
12
- client.chat(messages, model_id: model)['content']
20
+ options = { model_id: model }
21
+ options[:max_tokens] = params[:max_tokens] if params[:max_tokens]
22
+ options[:temperature] = params[:temperature] if params.key?(:temperature)
23
+ client.chat(messages, **options)['content']
13
24
  end
14
25
 
15
26
  def client
16
27
  @client ||= begin
17
28
  config = LlmConductor.configuration.provider_config(:groq)
18
- Groq::Client.new(api_key: config[:api_key])
29
+ Groq::Client.new(
30
+ api_key: config[:api_key],
31
+ max_tokens: config[:max_tokens] || DEFAULT_MAX_TOKENS,
32
+ request_timeout: config[:request_timeout] || DEFAULT_REQUEST_TIMEOUT
33
+ )
19
34
  end
20
35
  end
21
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LlmConductor
4
- VERSION = '1.8.0'
4
+ VERSION = '1.8.2'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llm_conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Zheng
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-06-10 00:00:00.000000000 Z
10
+ date: 2026-06-11 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport