mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-27 21:48:22 +00:00
Detect llama-swap, match embedding models by name.
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -25,6 +25,7 @@ class TracyLlmApi
|
||||
Unknown,
|
||||
Ollama,
|
||||
LmStudio,
|
||||
LlamaSwap,
|
||||
Other
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user