llm_gateway 0.9.0 → 0.10.0
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/CHANGELOG.md +26 -0
- data/README.md +149 -64
- data/Rakefile +5 -0
- data/docs/migration_guide_0.10.0.md +53 -0
- data/docs/structured-output.md +28 -0
- data/lib/llm_gateway/adapter_definition.rb +64 -0
- data/lib/llm_gateway/adapters/adapter.rb +105 -21
- data/lib/llm_gateway/adapters/anthropic/messages_adapter.rb +8 -0
- data/lib/llm_gateway/adapters/anthropic_option_mapper.rb +29 -19
- data/lib/llm_gateway/adapters/groq/chat_completions_adapter.rb +8 -0
- data/lib/llm_gateway/adapters/groq/option_mapper.rb +7 -9
- data/lib/llm_gateway/adapters/normalized_stream_accumulator.rb +7 -3
- data/lib/llm_gateway/adapters/openai/chat_completions/option_mapper.rb +7 -9
- data/lib/llm_gateway/adapters/openai/chat_completions/stream_mapper.rb +1 -1
- data/lib/llm_gateway/adapters/openai/chat_completions_adapter.rb +6 -0
- data/lib/llm_gateway/adapters/openai/responses/option_mapper.rb +11 -9
- data/lib/llm_gateway/adapters/openai/responses/stream_mapper.rb +1 -1
- data/lib/llm_gateway/adapters/openai/responses_adapter.rb +6 -0
- data/lib/llm_gateway/adapters/openai_codex/responses_adapter.rb +8 -0
- data/lib/llm_gateway/adapters/stream_mapper.rb +4 -3
- data/lib/llm_gateway/agents/harness.rb +63 -29
- data/lib/llm_gateway/agents/in_memory_session_manager.rb +35 -4
- data/lib/llm_gateway/agents/tools/tool_utils.rb +2 -2
- data/lib/llm_gateway/errors.rb +3 -0
- data/lib/llm_gateway/models/catalog.rb +68 -0
- data/lib/llm_gateway/models/cost_calculator.rb +47 -0
- data/lib/llm_gateway/models/definition.rb +325 -0
- data/lib/llm_gateway/models/explicit.rb +46 -0
- data/lib/llm_gateway/models/generated.json +3055 -0
- data/lib/llm_gateway/models.rb +78 -0
- data/lib/llm_gateway/prompt.rb +13 -13
- data/lib/llm_gateway/proxy/adapter.rb +22 -12
- data/lib/llm_gateway/proxy/client.rb +4 -4
- data/lib/llm_gateway/proxy/protocol.rb +50 -0
- data/lib/llm_gateway/proxy/server.rb +12 -9
- data/lib/llm_gateway/utils.rb +12 -6
- data/lib/llm_gateway/version.rb +1 -1
- data/lib/llm_gateway.rb +4 -67
- data/scripts/generate_model_catalog.rb +195 -0
- metadata +13 -4
- data/lib/llm_gateway/client.rb +0 -35
- data/lib/llm_gateway/provider_registry.rb +0 -37
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LlmGateway
|
|
4
|
+
module Models
|
|
5
|
+
module Explicit
|
|
6
|
+
# Legacy model IDs remain here because recorded streams still use them.
|
|
7
|
+
DEFINITIONS = [
|
|
8
|
+
{
|
|
9
|
+
provider: "anthropic",
|
|
10
|
+
id: "claude-sonnet-4-20250514",
|
|
11
|
+
name: "Claude Sonnet 4",
|
|
12
|
+
source: :explicit,
|
|
13
|
+
context_window: 200_000,
|
|
14
|
+
max_output_tokens: 64_000,
|
|
15
|
+
input_modalities: %i[text image],
|
|
16
|
+
output_modalities: %i[text],
|
|
17
|
+
capabilities: {
|
|
18
|
+
text_generation: true,
|
|
19
|
+
tool_calling: true,
|
|
20
|
+
structured_output: true,
|
|
21
|
+
reasoning: true
|
|
22
|
+
},
|
|
23
|
+
reasoning_controls: [ { type: "budget_tokens", min: 1_024, max: 13_312 } ],
|
|
24
|
+
pricing: { input: "3", output: "15", cache_read: "0.3", cache_write: "3.75" }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
provider: "groq",
|
|
28
|
+
id: "meta-llama/llama-4-scout-17b-16e-instruct",
|
|
29
|
+
name: "Llama 4 Scout 17B 16E",
|
|
30
|
+
source: :explicit,
|
|
31
|
+
context_window: 131_072,
|
|
32
|
+
max_output_tokens: 8_192,
|
|
33
|
+
input_modalities: %i[text image],
|
|
34
|
+
output_modalities: %i[text],
|
|
35
|
+
capabilities: {
|
|
36
|
+
text_generation: true,
|
|
37
|
+
tool_calling: true,
|
|
38
|
+
structured_output: true,
|
|
39
|
+
reasoning: false
|
|
40
|
+
},
|
|
41
|
+
pricing: { input: "0.11", output: "0.34", cache_read: "0", cache_write: "0" }
|
|
42
|
+
}
|
|
43
|
+
].freeze
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|