gpt4all/gpt4all-chat/llm.h

48 lines
1.2 KiB
C
Raw Normal View History

2023-04-09 03:28:39 +00:00
#ifndef LLM_H
#define LLM_H
#include <QObject>
2023-04-09 03:28:39 +00:00
class LLM : public QObject
{
Q_OBJECT
Q_PROPERTY(int32_t threadCount READ threadCount WRITE setThreadCount NOTIFY threadCountChanged)
2023-05-11 20:46:25 +00:00
Q_PROPERTY(bool serverEnabled READ serverEnabled WRITE setServerEnabled NOTIFY serverEnabledChanged)
Q_PROPERTY(bool compatHardware READ compatHardware NOTIFY compatHardwareChanged)
2023-04-09 03:28:39 +00:00
public:
static LLM *globalInstance();
int32_t threadCount() const;
void setThreadCount(int32_t n_threads);
2023-05-11 20:46:25 +00:00
bool serverEnabled() const;
void setServerEnabled(bool enabled);
bool compatHardware() const { return m_compatHardware; }
Q_INVOKABLE bool checkForUpdates() const;
Q_INVOKABLE bool directoryExists(const QString &path) const;
Q_INVOKABLE bool fileExists(const QString &path) const;
2023-06-22 19:44:49 +00:00
Q_INVOKABLE qint64 systemTotalRAMInGB() const;
Q_INVOKABLE QString systemTotalRAMInGBString() const;
2023-04-09 03:28:39 +00:00
Q_SIGNALS:
2023-05-01 21:13:20 +00:00
void chatListModelChanged();
2023-06-22 19:44:49 +00:00
void modelListChanged();
void threadCountChanged();
2023-05-11 20:46:25 +00:00
void serverEnabledChanged();
void compatHardwareChanged();
2023-04-09 03:28:39 +00:00
private:
int32_t m_threadCount;
2023-05-11 20:46:25 +00:00
bool m_serverEnabled;
bool m_compatHardware;
2023-04-09 03:28:39 +00:00
private:
explicit LLM();
~LLM() {}
friend class MyLLM;
};
#endif // LLM_H