From 9be51e192fca8901d47328875d9e0c690d4b2b99 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 17 Aug 2025 02:20:42 +0700 Subject: this was me. local LLM! --- src/lib/services/llm.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/lib/services/llm.ts (limited to 'src/lib/services/llm.ts') 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 { + const res = await this.api.send(text); + console.log({ res }); + return res; + } +} -- cgit v1.2.3