crmne / crmne/ruby_llm

[FEATURE] configure model deployments with non standard names to use the standard name for cost and capabilities discovery

Open
#940 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Ruby
Stars
4.4k
Forks
504
Avg merge
1d 8h
Merged PRs (30d)
11

Description

Scope check
  • This is core LLM communication (not application logic)
  • This benefits most users (not just my use case)
  • This can't be solved in application code with current RubyLLM
  • I read the Contributing Guide
Due diligence
  • I searched existing issues
  • I checked the documentation
What problem does this solve?

I have an azure model deployment named gpt-4o-global. This is a deployment of gpt-4o. It would be a nice feature to be able to create something like an alias (with a similar json file) that maps gpt-4o-global to gpt-4o, so that cost and capabilities of the model are known when a new Chat is created in the database.

Proposed solution

file lib/ruby_llm/cost_and_capability_mapping.json

{
  'got-4o-global': 'gpt-4o',
}

create a new Chat with gpt-4o-global with provider and assume_model_exists: true still uses the mapping for the model capabilities

chat = Chat.create(model: 'gpt-4o-global', provider: :azure, assume_model_exists: true)
chat.model
#<RubyLLM::ActiveRecord::Model:0x0000ffff6ab75650
 id: 1877,
 capabilities: ["function_calling", "structured_output", "vision", "tool_choice", "parallel_tool_calls"],
 context_window: 128000,
 created_at: "2026-09-17 17:36:31.195829000 -0400",
 family: "gpt",
 knowledge_cutoff: nil,
 max_output_tokens: "[FILTERED]",
 metadata:
  {"cost" => {"input" => 2.5, "output" => 10, "cache_read" => 1.25}, "limit" => {"output" => 16384, "context" => 128000}, "object" => "model", "source" => "models.dev", "owned_by" => "system", "knowledge" => "2023-09", "reasoning" => false, "tool_call" => true, "attachment" => true, "provider_id" => "openai", "temperature" => true, "last_updated" => "2024-08-06", "open_weights" => false, "structured_output" => true},
 modalities: {"input" => ["text", "image", "pdf"], "output" => ["text"]},
 model_created_at: "2024-05-12 20:00:00.000000000 -0400",
 model_id: "gpt-4o-global",
 name: "GPT 4o global",
 pricing: {"text_tokens" => {"standard" => {"input_per_million" => 2.5, "output_per_million" => 10, "cache_read_input_per_million" => 1.25}}},
 provider: "openai",
 unlisted_at: nil,
 updated_at: "2026-09-17 17:36:31.195829000 -0400">

instead of

#<RubyLLM::ActiveRecord::Model:0x0000ffff8256ba58
 id: 1817,
 capabilities: ["function_calling", "streaming", "vision", "structured_output"],
 context_window: nil,
 created_at: "2026-09-17 17:38:33.123566000 -0400",
 family: nil,
 knowledge_cutoff: nil,
 max_output_tokens: nil,
 metadata: {"warning" => "Assuming model exists, capabilities may not be accurate"},
 modalities: {"input" => ["text", "image"], "output" => ["text"]},
 model_created_at: nil,
 model_id: "gpt-4o-global",
 name: "Gpt 4o global",
 pricing: {},
 provider: "azure",
 unlisted_at: "2026-09-17 17:38:54.347494000 -0400",
 updated_at: "2026-09-17 17:38:54.349078000 -0400">
Why this belongs in RubyLLM

This would make costs stored in the database in messages more accurate. It would also help the harness know what actual capabilities a model has when using it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/ruby_llm/cost_and_capability_mapping.json and trace model creation when assume_model_exists is true. Implement the proposed alias mapping so a deployment such as gpt-4o-global uses the standard model's cost and capabilities while retaining its deployment model_id. Done means the stored model data reflects the mapped model rather than the fallback warning and empty pricing.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.