summaryrefslogtreecommitdiff
path: root/src/lib/services/llm.ts
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-08-17 02:20:42 +0700
committerpolwex <polwex@sortug.com>2025-08-17 02:20:42 +0700
commit9be51e192fca8901d47328875d9e0c690d4b2b99 (patch)
tree926151e075c539019c5eb65e2140678acb383c5f /src/lib/services/llm.ts
parentc505750ab36f8164256a91830fc83a807a9d6984 (diff)
this was me. local LLM!HEADmaster
Diffstat (limited to 'src/lib/services/llm.ts')
-rw-r--r--src/lib/services/llm.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/services/llm.ts b/src/lib/services/llm.ts
new file mode 100644
index 0000000..508423f
--- /dev/null
+++ b/src/lib/services/llm.ts
@@ -0,0 +1,16 @@
+import AIModelAPI, { type LLMChoice } from "sortug-ai";
+import type { AsyncRes } from "@/lib/types";
+
+export class LLM {
+ private api;
+ constructor(model: LLMChoice) {
+ const api = AIModelAPI(model);
+ this.api = api;
+ }
+
+ async chat(text: string): AsyncRes<string> {
+ const res = await this.api.send(text);
+ console.log({ res });
+ return res;
+ }
+}