feat(backend): full remote implementation, untested

This commit is contained in:
Shivering Ocelot committed 2026-09-02 10:46:51 -05:00
1 parent 0705f4abc5
commit 5009a4eb4c
8 files changed
+485 -33

No files matched your search

+5 -2
View File
@@ -15,19 +15,22 @@ CONTEXT_WINDOW = 10_000
# TODO: Rename to ChatMessage. Add methods for constructing from instruct/openai/etc formatted objects.
class LlamaMessage:
def __init__(self, role, content):
def __init__(self, role, content, reasoning=None):
if role not in VALID_ROLES:
raise Exception("message role must be one of: " + ",".join(VALID_ROLES))
self.role = role
self.content = content
self.reasoning = reasoning
def to_dict(self):
"""Serialize to the dict format expected by llama-cpp / ollama."""
d = {"role": self.role, "content": self.content}
if self.reasoning:
d["reasoning"] = self.reasoning
return d
def __repr__(self):
return f"LlamaMessage(role={self.role!r}, content={self.content!r})"
return f"LlamaMessage(role={self.role!r}, content={self.content!r}, reasoning={self.reasoning!r})"
class Models:
llama_8b = "meta/meta-llama-3-8b-instruct"