Make a separate fast model optional.

This commit is contained in:
Bartosz Taudul
2026-03-08 14:41:42 +01:00
parent 9f432d5fa2
commit b0dd2b291d
3 changed files with 11 additions and 2 deletions

View File

@@ -51,6 +51,7 @@ void LoadConfig()
if( ini_sget( ini, "llm", "annotateCallstacks", "%d", &v ) ) s_config.llmAnnotateCallstacks = v;
if( ini_sget( ini, "llm", "limitToolReplySize", "%d", &v ) ) s_config.llmLimitToolReplySize = v;
if( ini_sget( ini, "llm", "maxToolReplySizeValue", "%d", &v ) ) s_config.llmMaxToolReplySizeValue = v;
if( ini_sget( ini, "llm", "separateFastModel", "%d", &v ) ) s_config.llmSeparateFastModel = v;
ini_free( ini );
}
@@ -103,6 +104,7 @@ bool SaveConfig()
fprintf( f, "annotateCallstacks = %i\n", (int)s_config.llmAnnotateCallstacks );
fprintf( f, "limitToolReplySize = %i\n", (int)s_config.llmLimitToolReplySize );
fprintf( f, "maxToolReplySizeValue = %i\n", s_config.llmMaxToolReplySizeValue );
fprintf( f, "separateFastModel = %i\n", (int)s_config.llmSeparateFastModel );
fclose( f );
return true;

View File

@@ -44,6 +44,7 @@ struct Config
std::string llmSearchIdentifier;
std::string llmSearchApiKey;
std::string llmSearchBraveApiKey;
bool llmSeparateFastModel = true;
bool llmAnnotateCallstacks = false;
bool llmLimitToolReplySize = false;
int llmMaxToolReplySizeValue = 48*1024;

View File

@@ -240,8 +240,11 @@ void TracyLlm::Draw()
}
ImGui::AlignTextToFramePadding();
if( ImGui::Checkbox( "##useFastModel", &s_config.llmSeparateFastModel ) ) SaveConfig();
ImGui::SameLine();
TextDisabledUnformatted( ICON_FA_BOLT_LIGHTNING " Fast model:" );
ImGui::SameLine();
if( !s_config.llmSeparateFastModel ) ImGui::BeginDisabled();
if( models.empty() || m_fastIdx < 0 )
{
ImGui::TextUnformatted( "No models available" );
@@ -271,6 +274,7 @@ void TracyLlm::Draw()
ImGui::EndCombo();
}
}
if( !s_config.llmSeparateFastModel ) ImGui::EndDisabled();
ImGui::AlignTextToFramePadding();
TextDisabledUnformatted( ICON_FA_BOOK_BOOKMARK " Embeddings model:" );
@@ -732,7 +736,8 @@ void TracyLlm::WorkerThread()
auto param = m_currentJob->param2;
auto callback = m_currentJob->callback2;
lock.unlock();
auto response = m_api->SendMessage( param, m_fastIdx );
const int modelIdx = s_config.llmSeparateFastModel ? m_fastIdx : m_modelIdx;
auto response = m_api->SendMessage( param, modelIdx );
callback( response );
lock.lock();
break;
@@ -906,7 +911,8 @@ bool TracyLlm::QueueFastMessageLocking( const nlohmann::json& req, std::function
// requires m_jobsLock
bool TracyLlm::QueueFastMessage( const nlohmann::json& req, std::function<void(nlohmann::json)> callback )
{
if( !m_api->IsConnected() || m_fastIdx < 0 ) return false;
const int modelIdx = s_config.llmSeparateFastModel ? m_fastIdx : m_modelIdx;
if( !m_api->IsConnected() || modelIdx < 0 ) return false;
m_jobs.emplace_back( std::make_shared<WorkItem>( WorkItem {
.task = Task::FastMessage,
.callback2 = std::move( callback ),