Skip to content

Commit

Permalink
Refactor project
Browse files Browse the repository at this point in the history
Signed-off-by: kerthcet <[email protected]>
  • Loading branch information
kerthcet committed Nov 18, 2024
1 parent ba5ccbb commit b489f09
Show file tree
Hide file tree
Showing 24 changed files with 1,131 additions and 2,597 deletions.
10 changes: 10 additions & 0 deletions .github/workflow/kube-workflow-init.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Initialization Workflow

on:
workflow_dispatch:

jobs:
init:
uses: kerthcet/github-workflow-as-kube/.github/workflows/[email protected]
secrets:
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflow/kube-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Event Workflow

on:
issues:
types:
- opened
issue_comment:
types:
- created
pull_request_target:
types:
- opened
- synchronize
- labeled
- unlabeled

jobs:
event-handler:
uses: kerthcet/github-workflow-as-kube/.github/workflows/[email protected]
secrets:
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM python:3.10-slim

RUN mkdir -p /app/llmaz
RUN mkdir -p /app/llmboard
WORKDIR /app

COPY requirements.txt .
RUN python -m pip install --upgrade pip && \
pip install -r requirements.txt

COPY main.py .
COPY llmaz/ ./llmaz
COPY llmboard/ ./llmboard

EXPOSE 7860
CMD ["python", "main.py"]
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Console for LLMAZ
# ChatUI for LLMs on llmaz

A dashboard for [llmaz](https://github.com/InftyAI/llmaz) to interact with LLM workloads.
A console for [llmaz](https://github.com/InftyAI/llmaz) to interact with LLM workloads.

## How to deploy

Run `make launch` then visit `http://localhost:7860` for Console.

![console](./docs/asserts/preview.jpg)

## 👏 Contributors

Thanks to all these contributors. You're the heroes.

<a href="https://github.com/InftyAI/llmaz-webui/graphs/contributors">
<img src="https://contrib.rocks/image?repo=InftyAI/llmaz-webui" />
</a>
23 changes: 0 additions & 23 deletions console/serve/chatbot.py

This file was deleted.

32 changes: 0 additions & 32 deletions console/serve/serve.py

This file was deleted.

21 changes: 0 additions & 21 deletions console/webui/engine.py

This file was deleted.

23 changes: 0 additions & 23 deletions console/webui/webui.py

This file was deleted.

8 changes: 0 additions & 8 deletions console/webui/webui_finetune.py

This file was deleted.

8 changes: 0 additions & 8 deletions console/webui/webui_prompt.py

This file was deleted.

84 changes: 0 additions & 84 deletions console/webui/webui_serving.py

This file was deleted.

Binary file removed docs/asserts/preview.jpg
Binary file not shown.
File renamed without changes.
12 changes: 12 additions & 0 deletions llmboard/libs/consts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GVKs
group = "llmaz.io"
version = "v1alpha1"
openmodel_plural = "openmodels"

# object label keys.
label_key_family_name = "llmaz.io/model-family-name"
label_key_model_name = "llmaz.io/model-name"

# Model hubs.
huggingface = "Huggingface"
modelscope = "ModelScope"
9 changes: 9 additions & 0 deletions llmboard/libs/inference_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from dataclasses import dataclass


@dataclass(frozen=True)
class InferenceService:
name: str
namespace: str
model_family_name: str
model_name: str
21 changes: 21 additions & 0 deletions llmboard/libs/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from kubernetes import client
from kubernetes.client import CustomObjectsApi

from llmboard.libs.consts import group, version, openmodel_plural


def get_openmodel_objects(api: CustomObjectsApi, namespace: None):
try:
if namespace:
# TODO: we do not support namespaced models yet.
raise NotImplementedError("do not support namespaced models yet")
else:
response = api.list_cluster_custom_object(
group=group,
version=version,
plural=openmodel_plural,
)
return response.get("items", [])
except client.exceptions.ApiException as e:
print(f"Error fetching OpenModel objects: {e}")
return []
File renamed without changes.
12 changes: 12 additions & 0 deletions llmboard/webui/engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from kubernetes import config
from llmboard.libs.models import get_openmodel_objects


class Engine:
def __init__(self) -> None:
# config.load_incluster_config()
pass

def get_models(self):
# objs = get_openmodel_objects()
pass
17 changes: 17 additions & 0 deletions llmboard/webui/webui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import gradio as gr

from llmboard.webui.engine import Engine
from llmboard.webui.webui_chat import create_chat_webui
from llmboard.webui.webui_market import create_market_webui


def launch_webui() -> gr.Blocks:
engine = Engine()

with gr.Blocks(title="llmboard") as blocks:
# TODO: Model Market Tab, list and create serving services.
# create_market_webui(engine)
# Serving Tab
create_chat_webui(engine)

return blocks
Loading

0 comments on commit b489f09

Please sign in to comment.