Skip to content

Use Parsera LLM Specs API instead of capabilities.rb #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crmne
Copy link
Owner

@crmne crmne commented Apr 22, 2025

  • Removed the OpenAI capabilities module and related methods.
  • Simplified model parsing for OpenAI and Gemini providers, focusing on essential attributes.
  • Introduced a new utility method for deep key symbolization in hashes.
  • Updated OpenRouter model parsing to enhance data extraction and structure.
  • Deleted obsolete browser and CLI helper tasks to streamline the codebase.
  • Consolidated model updater logic into the Rake task for better maintainability.
  • Improved error handling and logging throughout the model update process.
- Removed the OpenAI capabilities module and related methods.
- Simplified model parsing for OpenAI and Gemini providers, focusing on essential attributes.
- Introduced a new utility method for deep key symbolization in hashes.
- Updated OpenRouter model parsing to enhance data extraction and structure.
- Deleted obsolete browser and CLI helper tasks to streamline the codebase.
- Consolidated model updater logic into the Rake task for better maintainability.
- Improved error handling and logging throughout the model update process.
@crmne crmne marked this pull request as draft April 22, 2025 10:34
@crmne crmne changed the title Refactor RubyLLM provider capabilities and model parsing to use Parsera Apr 22, 2025
module Utils
module_function

def symbolize_keys_deep(hash)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is like ActiveSupport's deep_symbolize_keys, which I also needed in 2 PRs here and here

You'll want to cover Array child items though, so I recommend just taking my/ActiveSupport's implementation and putting it here, then I'll refactor my PRs to use your Util method instead.

end

def fetch_parsera_models
response = Faraday.new('https://api.parsera.org/v1/llm-specs', request: { timeout: 60 })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the idea of a core dependency on a commercial 3rd party's API, though very much appreciate the value that Parsera is doing by standardizing LLM capabilities into a JSON.

I know the code isn't called during any main runtime functions and also appreciate the support from Parsera (seems like great company).

Maybe just move this code to the rake task? Don't feel strongly about this so if you don't want to that's fine.

@jayelkaake
Copy link

jayelkaake commented Apr 22, 2025

Love this - the initiative by Parsera to standarize capabilities of models is fantastic!

Although, I'm not confident that the LLMs are going to follow the same configs within the same capabilities so I question whether the capabilities should just be implemented in the provider classes (and if they're not implemented it means they aren't supported).

For example, structured output is supported by Gemini but it is a vastly different implementation than the other LLMs.

Anyways, still prob good to do this since it's just a better implementation of how the gem already works today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants