From eae3c7ef80607af87e40009fcbd00afcd5d5bc31 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 20 May 2025 22:42:40 +0200 Subject: [PATCH] Remove LLM config from global settings (leave just LLM checkbox). --- profiler/src/main.cpp | 176 +----------------------------------------- 1 file changed, 1 insertion(+), 175 deletions(-) diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index be74a37c..7762947e 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -35,7 +35,6 @@ #include "profiler/TracyConfig.hpp" #include "profiler/TracyFileselector.hpp" #include "profiler/TracyImGui.hpp" -#include "profiler/TracyLlm.hpp" #include "profiler/TracyMouse.hpp" #include "profiler/TracyProtoHistory.hpp" #include "profiler/TracyStorage.hpp" @@ -125,7 +124,6 @@ tracy::Config s_config; tracy::AchievementsMgr* s_achievements; static const tracy::data::AchievementItem* s_achievementItem = nullptr; static bool s_switchAchievementCategory = false; -static std::unique_ptr llmProbe; static float smoothstep( float x ) { @@ -446,7 +444,6 @@ int main( int argc, char** argv ) if( updateThread.joinable() ) updateThread.join(); if( updateNotesThread.joinable() ) updateNotesThread.join(); view.reset(); - llmProbe.reset(); tracy::FreeTexture( zigzagTex, RunOnMainThread ); tracy::FreeTexture( iconTex, RunOnMainThread ); @@ -859,180 +856,10 @@ static void DrawContents() ImGui::Spacing(); if( ImGui::Checkbox( "Enable achievements", &s_config.achievements ) ) SaveConfig(); + ImGui::Spacing(); if( ImGui::Checkbox( "Save UI scale", &s_config.saveUserScale) ) SaveConfig(); - ImGui::Spacing(); if( ImGui::Checkbox( "Enable LLM", &s_config.llm ) ) SaveConfig(); - if( s_config.llm ) - { - static int llmstatus = 0; - static std::string llmVersion; - static std::vector llmModels; - - ImGui::Indent(); - ImGui::TextUnformatted( "Ollama URL" ); - ImGui::SameLine(); - if( ImGui::Button( ICON_FA_ARROWS_ROTATE ) ) - { - llmstatus = 0; - llmModels.clear(); - s_config.llmAddress = "http://localhost:11434"; - SaveConfig(); - llmProbe.reset(); - } - ImGui::SameLine(); - char llmAddress[1024]; - snprintf( llmAddress, sizeof( llmAddress ), "%s", s_config.llmAddress.c_str() ); - ImGui::SetNextItemWidth( 225 * dpiScale ); - if( ImGui::InputText( "##ollamaurl", llmAddress, sizeof( llmAddress ) ) ) - { - llmstatus = 0; - llmModels.clear(); - s_config.llmAddress = llmAddress; - SaveConfig(); - llmProbe.reset(); - } - - if( llmstatus == 1 ) ImGui::BeginDisabled(); - const bool doCheck = ImGui::Button( ICON_FA_PLUG " Check connection" ); - if( llmstatus == 1 ) ImGui::EndDisabled(); - if( doCheck ) - { - llmstatus = 1; - llmProbe = std::make_unique(); - activeFrames = 3; - } - else if( llmProbe ) - { - activeFrames = 3; - if( llmProbe->IsValid() ) - { - if( !llmProbe->IsBusy() ) - { - llmstatus = 2; - llmVersion = llmProbe->GetVersion(); - llmModels = llmProbe->GetModels(); - } - } - else - { - llmstatus = 3; - llmProbe.reset(); - } - } - - ImGui::TextDisabled( "Connection status:" ); - ImGui::SameLine(); - switch( llmstatus ) - { - case 0: - ImGui::TextUnformatted( "Unknown" ); - break; - case 1: - ImGui::TextColored( ImVec4( 1, 1, 0.5f, 1 ), "Checking..." ); - break; - case 2: - ImGui::TextColored( ImVec4( 0.5f, 1, 0.5f, 1 ), "Valid" ); - ImGui::SameLine(); - ImGui::TextDisabled( "(%s)", llmVersion.c_str() ); - break; - case 3: - ImGui::TextColored( ImVec4( 1, 0.5f, 0.5f, 1 ), "Failed" ); - break; - default: - assert( false ); - break; - } - - if( llmstatus == 2 ) - { - if( !llmModels.empty() ) - { - ImGui::TextDisabled( "Selected model:" ); - int sel; - for( sel=0; selNotifyRootWindowSize( display_w, display_h ); if( !view->Draw() ) {