feat : better server provider

This commit is contained in:
martin legrand
2025-03-29 11:46:22 +01:00
parent 0bf813e865
commit a4cfa9c651
10 changed files with 186 additions and 91 deletions
+22
View File
@@ -0,0 +1,22 @@
from .generator import GeneratorLLM
class LlamacppLLM(GeneratorLLM):
from llama_cpp import Llama
def __init__(self):
"""
Handle generation using llama.cpp
"""
super().__init__()
self.llm = Llama.from_pretrained(
repo_id=self.model,
filename="*q8_0.gguf",
verbose=True
)
def generate(self, history):
self.logger.info(f"Using {self.model} for generation with Llama.cpp")
self.llm.create_chat_completion(
messages = history
)