diff --git a/profiler/src/profiler/TracyLlmApi.cpp b/profiler/src/profiler/TracyLlmApi.cpp index 410649d9..c5904605 100644 --- a/profiler/src/profiler/TracyLlmApi.cpp +++ b/profiler/src/profiler/TracyLlmApi.cpp @@ -61,7 +61,12 @@ bool TracyLlmApi::Connect( const char* url ) m_models.emplace_back( LlmModel { .name = id } ); std::string buf2; - if( ( m_type == Type::Unknown || m_type == Type::LmStudio ) && GetRequest( m_url + "/api/v0/models/" + id, buf2 ) == 200 ) + if( ( m_type == Type::Unknown || m_type == Type::LlamaSwap ) && GetRequest( m_url + "/running", buf2 ) == 200 && buf2.starts_with( "{\"running\":" ) ) + { + m_type = Type::LlamaSwap; + if( id.find( "embed" ) != std::string::npos ) m_models.back().embeddings = true; + } + else if( ( m_type == Type::Unknown || m_type == Type::LmStudio ) && GetRequest( m_url + "/api/v0/models/" + id, buf2 ) == 200 ) { m_type = Type::LmStudio; auto json2 = nlohmann::json::parse( buf2 ); diff --git a/profiler/src/profiler/TracyLlmApi.hpp b/profiler/src/profiler/TracyLlmApi.hpp index b117a98a..13eeedbd 100644 --- a/profiler/src/profiler/TracyLlmApi.hpp +++ b/profiler/src/profiler/TracyLlmApi.hpp @@ -25,6 +25,7 @@ class TracyLlmApi Unknown, Ollama, LmStudio, + LlamaSwap, Other };