Added GitHub LLM provider and models.

Added new GPT-5 models.
This commit is contained in:
Martín Lucas Golini
2025-08-08 00:37:17 -03:00
parent 05c0f93aea
commit 61c3e72289
3 changed files with 89 additions and 11 deletions

View File

@@ -217,10 +217,6 @@
"api_url": "https://api.openai.com/v1/chat/completions",
"display_name": "OpenAI",
"models": [
{
"max_tokens": 16385,
"name": "gpt-3.5-turbo"
},
{
"max_tokens": 8192,
"name": "gpt-4"
@@ -241,10 +237,6 @@
"max_tokens": 200000,
"name": "o1"
},
{
"max_tokens": 128000,
"name": "o1-preview"
},
{
"max_tokens": 128000,
"name": "o1-mini"
@@ -254,8 +246,7 @@
"name": "o3-mini"
},
{
"name": "gpt-4.1-nano",
"cheapest": true
"name": "gpt-4.1-nano"
},
{
"name": "gpt-4.1-mini"
@@ -276,7 +267,14 @@
"name": "o1-pro"
},
{
"name": "gpt-4.5-preview"
"name": "gpt-5"
},
{
"name": "gpt-5-mini"
},
{
"name": "gpt-5-nano",
"cheapest": true
}
],
"version": 1
@@ -293,6 +291,69 @@
"name": "grok-3-latest"
}
]
},
"github": {
"api_url": "https://models.github.ai/inference/chat/completions",
"display_name": "GitHub",
"models": [
{
"name": "openai/gpt-4.1",
"display_name": "GitHub OpenAI GPT-4.1",
"tool_calling": true
},
{
"name": "openai/gpt-4.1-mini",
"display_name": "GitHub OpenAI GPT-4.1 Mini",
"tool_calling": true
},
{
"name": "openai/o3",
"display_name": "GitHub OpenAI o3",
"reasoning": true,
"tool_calling": true
},
{
"name": "openai/o3-mini",
"display_name": "GitHub OpenAI o3 Mini",
"reasoning": true,
"tool_calling": true
},
{
"name": "openai/o4-mini",
"display_name": "GitHub OpenAI o4 Mini",
"reasoning": true,
"tool_calling": true
},
{
"name": "deepseek/deepseek-v3-0324",
"display_name": "GitHub DeepSeek V3-0324"
},
{
"name": "mistral-ai/codestral-2501",
"display_name": "GitHub Mistral Codestral 25.01"
},
{
"name": "meta/llama-4-scout-17b-16e-instruct",
"display_name": "GitHub Meta Llama 4 Scout 17B",
"reasoning": true,
"tool_calling": true
},
{
"name": "deepseek/deepseek-r1-0528",
"display_name": "GitHub DeepSeek R1-0528",
"tool_calling": true
},
{
"name": "xai/grok-3",
"display_name": "GitHub xAI Grok 3",
"reasoning": true
},
{
"name": "xai/grok-3-mini",
"display_name": "GitHub xAI Grok 3 Mini",
"cheapest": true
}
]
}
}
}

View File

@@ -87,6 +87,14 @@ static std::map<std::string, LLMProvider> parseLLMProviders( const nlohmann::jso
model.cheapest = modelJson.value( "cheapest", false );
}
if ( modelJson.contains( "reasoning" ) ) {
model.reasoning = modelJson.value( "reasoning", false );
}
if ( modelJson.contains( "tool_calling" ) ) {
model.toolCalling = modelJson.value( "tool_calling", false );
}
if ( modelJson.contains( "cache_configuration" ) &&
!modelJson["cache_configuration"].is_null() ) {
const auto& cacheJson = modelJson["cache_configuration"];
@@ -308,6 +316,11 @@ void AIAssistantPlugin::loadAIAssistantConfig( const std::string& path, bool upd
mApiKeys["xai"] = config.value( "xai_api_key", "" );
else if ( updateConfigFile )
config["xai_api_key"] = mApiKeys["xai"];
if ( config.contains( "github_api_key" ) )
mApiKeys["github"] = config.value( "github_api_key", "" );
else if ( updateConfigFile )
config["github_api_key"] = mApiKeys["github"];
}
if ( mKeyBindings.empty() ) {
@@ -486,6 +499,8 @@ std::optional<std::string> AIAssistantPlugin::getApiKeyFromProvider( const std::
ret = apiKey;
else
ret = getenv( "GROK_API_KEY" );
} else if ( provider == "github" ) {
ret = getenv( "GITHUB_API_KEY" );
}
if ( ret )
return std::string{ ret };

View File

@@ -23,6 +23,8 @@ struct LLMModel {
std::optional<LLMCacheConfiguration> cacheConfiguration;
bool isEphemeral{ false };
bool cheapest{ false };
bool reasoning{ false };
bool toolCalling{ false };
};
struct LLMProvider {