From 7512783b5ca330282c9c6c78744df5f2222b83d1 Mon Sep 17 00:00:00 2001 From: killian <63927363+KillianLucas@users.noreply.github.com> Date: Fri, 26 Jan 2024 23:45:20 -0800 Subject: [PATCH] Structure --- .../conversations/another-interpreter.json | 0 .../{ => interpreter}/conversations/user.json | 0 OS/01/core/{server.py => interpreter/main.py} | 4 +++- OS/01/core/{ => interpreter}/queue/timestamp.json | 0 OS/01/core/{main.py => interpreter/start.py} | 8 ++++---- OS/01/core/llm/{ => models}/mistral.llamafile | 0 OS/01/core/llm/{ => models}/moonbeam.llamafile | 0 OS/01/core/llm/{setup.py => start.py} | 4 +++- OS/01/core/pyproject.toml | 15 +++++++++++++++ OS/01/core/start.sh | 7 +++++++ OS/01/start.sh | 10 ++++++++-- OS/README.md | 4 ++++ 12 files changed, 44 insertions(+), 8 deletions(-) rename OS/01/core/{ => interpreter}/conversations/another-interpreter.json (100%) rename OS/01/core/{ => interpreter}/conversations/user.json (100%) rename OS/01/core/{server.py => interpreter/main.py} (83%) rename OS/01/core/{ => interpreter}/queue/timestamp.json (100%) rename OS/01/core/{main.py => interpreter/start.py} (93%) rename OS/01/core/llm/{ => models}/mistral.llamafile (100%) rename OS/01/core/llm/{ => models}/moonbeam.llamafile (100%) rename OS/01/core/llm/{setup.py => start.py} (91%) create mode 100644 OS/01/core/pyproject.toml create mode 100644 OS/01/core/start.sh diff --git a/OS/01/core/conversations/another-interpreter.json b/OS/01/core/interpreter/conversations/another-interpreter.json similarity index 100% rename from OS/01/core/conversations/another-interpreter.json rename to OS/01/core/interpreter/conversations/another-interpreter.json diff --git a/OS/01/core/conversations/user.json b/OS/01/core/interpreter/conversations/user.json similarity index 100% rename from OS/01/core/conversations/user.json rename to OS/01/core/interpreter/conversations/user.json diff --git a/OS/01/core/server.py b/OS/01/core/interpreter/main.py similarity index 83% rename from OS/01/core/server.py rename to OS/01/core/interpreter/main.py index 399f8cc..6fcaf18 100644 --- a/OS/01/core/server.py +++ b/OS/01/core/interpreter/main.py @@ -2,13 +2,15 @@ Responsible for taking an interpreter, then serving it at "/" as a POST SSE endpoint, accepting and streaming LMC Messages. https://docs.openinterpreter.com/protocols/lmc-messages + +Also needs to be saving conversations, and checking the queue. """ from typing import Generator import uvicorn from fastapi import FastAPI, Request, Response -def serve(interpreter): +def main(interpreter): app = FastAPI() diff --git a/OS/01/core/queue/timestamp.json b/OS/01/core/interpreter/queue/timestamp.json similarity index 100% rename from OS/01/core/queue/timestamp.json rename to OS/01/core/interpreter/queue/timestamp.json diff --git a/OS/01/core/main.py b/OS/01/core/interpreter/start.py similarity index 93% rename from OS/01/core/main.py rename to OS/01/core/interpreter/start.py index 6d9c8a3..287f381 100644 --- a/OS/01/core/main.py +++ b/OS/01/core/interpreter/start.py @@ -1,8 +1,8 @@ """ -Responsible for configuring an interpreter, then using server.py to serve it at "/". +Responsible for configuring an interpreter, then using main.py to serve it at "/". """ -from .server import serve +from .main import main from interpreter import interpreter @@ -58,6 +58,6 @@ interpreter.offline = True interpreter.id = 206 # Used to identify itself to other interpreters. This should be changed programatically so it's unique. -### START SERVER +### SERVE INTERPRETER AT "/" -serve(interpreter) \ No newline at end of file +main(interpreter) \ No newline at end of file diff --git a/OS/01/core/llm/mistral.llamafile b/OS/01/core/llm/models/mistral.llamafile similarity index 100% rename from OS/01/core/llm/mistral.llamafile rename to OS/01/core/llm/models/mistral.llamafile diff --git a/OS/01/core/llm/moonbeam.llamafile b/OS/01/core/llm/models/moonbeam.llamafile similarity index 100% rename from OS/01/core/llm/moonbeam.llamafile rename to OS/01/core/llm/models/moonbeam.llamafile diff --git a/OS/01/core/llm/setup.py b/OS/01/core/llm/start.py similarity index 91% rename from OS/01/core/llm/setup.py rename to OS/01/core/llm/start.py index 19c998d..1d7a1f6 100644 --- a/OS/01/core/llm/setup.py +++ b/OS/01/core/llm/start.py @@ -2,6 +2,8 @@ Responsible for setting up the language model, downloading it if necessary. Ideally should pick the best LLM for the hardware. + +Should this be a shell script? """ import os @@ -11,7 +13,7 @@ import subprocess ### LLM SETUP # Define the path to the models directory -models_dir = "01/core/models/" +models_dir = "models/" # Check and create the models directory if it doesn't exist if not os.path.exists(models_dir): diff --git a/OS/01/core/pyproject.toml b/OS/01/core/pyproject.toml new file mode 100644 index 0000000..833c25f --- /dev/null +++ b/OS/01/core/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "01-core" +version = "0.0.1" +description = "The python at the heart of the 01." +authors = ["Open Interpreter "] +license = "AGPL" +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/OS/01/core/start.sh b/OS/01/core/start.sh new file mode 100644 index 0000000..33156a7 --- /dev/null +++ b/OS/01/core/start.sh @@ -0,0 +1,7 @@ +### START THE LANGUAGE MODEL + +python llm/start.py + +### START THE INTERPRETER + +python interpreter/start.py \ No newline at end of file diff --git a/OS/01/start.sh b/OS/01/start.sh index 0063d5b..04b78cd 100644 --- a/OS/01/start.sh +++ b/OS/01/start.sh @@ -1,5 +1,11 @@ +### APP + # Display app/index.html on the second monitor in full-screen mode +google-chrome --kiosk --app=file:///app/index.html + -# Setup the language model +### CORE -# Setup and serve the interpreter at "/" \ No newline at end of file +cd /core +poetry install +poetry run bash start.sh \ No newline at end of file diff --git a/OS/README.md b/OS/README.md index bbeb1c6..1c5adf3 100644 --- a/OS/README.md +++ b/OS/README.md @@ -14,6 +14,10 @@ This folder contains everything we want to change from the base Ubuntu. A folder I imagine we'll use something like Cubic to then press this + Ubuntu into an ISO image. +# Setup & Usage + +Clone this repo, then run `OS/01/start.sh`. + # Structure ### `start.sh`