Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
LLM_API_KEY=github_pat_...
LLM_BASE_URL=https://models.github.ai/inference
LLM_MODEL=openai/gpt-4.1-mini
LLM_RPM=60

EMBEDDER_API_KEY=github_pat_...
EMBEDDER_BASE_URL=https://models.github.ai/inference
EMBEDDER_MODEL=text-embedding-3-large
EMBEDDER_DIM=3072

RAGU_STORAGE=ragu_data
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* -text
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.otf binary
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# $mol
-*
.DS_Store

checkpoints/
benchmark/*.json
ragu_working_dir/
Expand Down Expand Up @@ -175,4 +179,4 @@ cython_debug/
.ruff_cache/

# PyPI configuration file
.pypirc
.pypirc
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# --- Frontend ---
FROM node:20-alpine AS frontend

RUN apk add --no-cache git

WORKDIR /app
RUN git clone --depth 1 https://github.com/hyoo-ru/mam.git . \
&& npm install

COPY front/ bog/RAGU/front/

RUN npx mam bog/RAGU/front/app

EXPOSE 9080

CMD ["npm", "start"]


# --- API ---
FROM python:3.12-slim AS api

WORKDIR /app

COPY pyproject.toml ./
COPY ragu/ ./ragu/
RUN pip install --no-cache-dir .

COPY server/ ./server/
RUN pip install --no-cache-dir -r server/requirements.txt

EXPOSE 8000

CMD ["uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "8000"]
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
services:
web:
build:
context: .
dockerfile: Dockerfile
target: frontend
ports:
- "9081:9080"
restart: unless-stopped
tty: true
stdin_open: true
develop:
watch:
- action: sync
path: ./front
target: /app/bog/RAGU/front

# http://localhost:9081/bog/RAGU/front/app/-/test.html

api:
platform: linux/arm64
build:
context: .
dockerfile: Dockerfile
target: api
ports:
- "8100:8000"
restart: unless-stopped
env_file: .env
environment:
- NUMBA_CPU_NAME=generic
volumes:
- ragu_data:/app/ragu_data
develop:
watch:
- action: sync+restart
path: ./server
target: /app/server

# http://localhost:8100/api/status

volumes:
ragu_data:
1 change: 1 addition & 0 deletions front/app/app.meta.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include \/mol/offline/install
42 changes: 42 additions & 0 deletions front/app/app.view.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
namespace $.$$ {

$mol_style_define( $bog_RAGU_front_app, {

Documents: {
flex: {
basis: '30rem',
grow: 1,
},
Body: {
flex: {
grow: 1,
},
},
},

Doc_text: {
flex: {
grow: 1,
},
minHeight: '20rem',
},

Doc_file: {
alignItems: 'center',
gap: '.5rem',
},

Index_record: {
alignItems: 'center',
gap: '.5rem',
},

Settings_page: {
flex: {
basis: '25rem',
},
},

} )

}
94 changes: 94 additions & 0 deletions front/app/app.view.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
$bog_RAGU_front_app $giper_bot
dialog_title @ \RAGU
api_url \http://localhost:8100
history? /
doc_text? \
doc_files? /
index_message? \
index_records? /
config_message? \
llm_api_key? \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
llm_base_url? \https://models.github.ai/inference
llm_model? \openai/gpt-4.1-mini
llm_rpm? \60
embedder_api_key? \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
embedder_base_url? \https://models.github.ai/inference
embedder_model? \text-embedding-3-large
embedder_dim? \3072
Doc_file* $mol_row
sub /
<= Doc_file_icon* $mol_icon_file
<= Doc_file_name* $mol_view
sub /
<= doc_file_name* \
<= Doc_file_remove* $mol_button_minor
click? <=> doc_file_remove*? null
sub /
<= Doc_file_remove_icon* $mol_icon_close
Index_record* $mol_row
sub /
<= Index_record_icon* $mol_icon_check
<= Index_record_info* $mol_view
sub /
<= index_record_text* \
Documents $mol_page
title @ \Documents
body /
<= Doc_text $mol_textarea
hint @ \Paste text to build knowledge graph...
value? <=> doc_text?
<= Doc_open $mol_button_open
title @ \Add Files
accept \.txt,.md,.csv,.json,.xml,.html,.docx
files? <=> doc_files_add? null
<= Doc_file_list $mol_list
rows <= doc_file_rows /
<= Index_submit $mol_button_major
title @ \Build Knowledge Graph
click? <=> index_submit? null
<= Index_message $mol_text
text <= index_message?
<= Index_record_list $mol_list
rows <= index_record_rows /
Settings_page $mol_page
title @ \Settings
body /
<= Llm_api_key $mol_form_field
name @ \LLM API Key
Content <= Llm_api_key_input $mol_string
hint \sk-...
value? <=> llm_api_key?
<= Llm_base_url $mol_form_field
name @ \LLM Base URL
Content <= Llm_base_url_input $mol_string
value? <=> llm_base_url?
<= Llm_model $mol_form_field
name @ \LLM Model
Content <= Llm_model_input $mol_string
value? <=> llm_model?
<= Llm_rpm $mol_form_field
name @ \LLM RPM
Content <= Llm_rpm_input $mol_string
value? <=> llm_rpm?
<= Embedder_api_key $mol_form_field
name @ \Embedder API Key
Content <= Embedder_api_key_input $mol_string
hint \sk-...
value? <=> embedder_api_key?
<= Embedder_base_url $mol_form_field
name @ \Embedder Base URL
Content <= Embedder_base_url_input $mol_string
value? <=> embedder_base_url?
<= Embedder_model $mol_form_field
name @ \Embedder Model
Content <= Embedder_model_input $mol_string
value? <=> embedder_model?
<= Embedder_dim $mol_form_field
name @ \Embedder Dim
Content <= Embedder_dim_input $mol_string
value? <=> embedder_dim?
<= Config_save $mol_button_major
title @ \Save
click? <=> config_save? null
<= Config_message $mol_text
text <= config_message?
Loading