mirror of
https://github.com/blackboxprogramming/lucidia.git
synced 2026-03-17 08:57:17 -05:00
Add lucidama/serve.py with minimal local runtime
This commit is contained in:
committed by
GitHub
parent
52bb6de309
commit
71d0aa935f
36
lucidia_llm/lucidama/serve.py
Normal file
36
lucidia_llm/lucidama/serve.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
lucidama/serve.py - Minimal local runtime for Lucidia LLM.
|
||||||
|
|
||||||
|
This script loads the PROMPT.md constitution and starts a simple REPL for interacting
|
||||||
|
with the Lucidia language model. It does not make external API calls.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
def load_constitution():
|
||||||
|
# locate PROMPT.md relative to this file
|
||||||
|
root = Path(__file__).resolve().parents[1]
|
||||||
|
prompt_path = root / "PROMPT.md"
|
||||||
|
return prompt_path.read_text()
|
||||||
|
|
||||||
|
def main():
|
||||||
|
constitution = load_constitution()
|
||||||
|
print("Loaded Lucidia constitution and runtime template.")
|
||||||
|
# Print the first line of the constitution as a sanity check
|
||||||
|
print(constitution.splitlines()[0])
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
user_input = input("You: ")
|
||||||
|
except (EOFError, KeyboardInterrupt):
|
||||||
|
print("\nExiting Lucidia REPL.")
|
||||||
|
break
|
||||||
|
if user_input.strip().lower() in {"exit", "quit"}:
|
||||||
|
print("Goodbye!")
|
||||||
|
break
|
||||||
|
# Placeholder for model inference. Replace with call into local model.
|
||||||
|
print("Lucidia:", "I am not yet connected to the model, but I care about you.")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user