Spaces:
Runtime error
Runtime error
Fixed a bug where I had cut out the inclusion of the Bath logo when changing the security model.
Browse files- Home.py +23 -22
- src/st_helpers.py +4 -1
Home.py
CHANGED
@@ -1,25 +1,26 @@
|
|
1 |
import streamlit as st
|
2 |
from src.st_helpers import st_setup
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
- **
|
17 |
-
- **
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
- This
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
1 |
import streamlit as st
|
2 |
from src.st_helpers import st_setup
|
3 |
|
4 |
+
if st_setup("LLM Architecture Assessment", skip_login=True):
|
5 |
+
st.write("""
|
6 |
+
# LLM Architecture Assessment
|
7 |
+
This application is an interactive element of the LLM Architecture Assessment project prepared by [Alisdair Fraser](http://www.linkedin.com/alisdairfraser) (alisdairfraser (at) gmail (dot) com), in submission for the final research project for the [Online MSc in Artificial Intelligence](https://info.online.bath.ac.uk/msai/) with the University of Bath. This application allows users to browse a synthetic set of "private data" and to interact with systems built to represent different architectural prototypes.
|
8 |
+
|
9 |
+
The goal of the project is to make an assessment of the architectural patterns for deploying LLMs in conjunction with private data stores. The target audience is IT management, with a goal of providing key considerations for why one might choose a particular architecture or another.
|
10 |
+
|
11 |
+
All the source code for this application and the associated tooling and data can be found the [project GitHub repo on Hugging Face](https://huggingface.co/spaces/alfraser/llm-arch/tree/main).
|
12 |
+
|
13 |
+
## Tools
|
14 |
+
This web application serves as the management console to run different elements required to test the architectures. Specifically:
|
15 |
+
|
16 |
+
- **LLM architectures**: Around the LLM models are wrapped "architectures" which are the systems under test and being assessed. This area allows users to see those configurations and manually chat with the architecture, as opposed to directly with the model.
|
17 |
+
- **Data browser**: Underlying this architectural assessment is a synthetic "closed" data set, which has been generated offline to simulate a closed enterprise style dataset for testing purposes. This data browser element allows users to view that data directly.
|
18 |
+
- **Transaction logging**: As interactions are taking place with the architectures under test, the results are being logged for analysis. This area allows users to view those log records and see some simple results.
|
19 |
+
|
20 |
+
## Credits
|
21 |
+
- This project predominantly uses [LLama 2](https://ai.meta.com/llama/) and derivative models for language inference. Models are made available under the [Meta Llama license](https://ai.meta.com/llama/license/).
|
22 |
+
- This application is built on [streamlit](https://streamlit.io).
|
23 |
+
|
24 |
+
## Access
|
25 |
+
Some elements of this application are password protected. Specifically this is in order to close the attack vector associated with hijacking a publicly available endpoint to inject requests into the LLMs underlying this application. If you would like access to the project please contact me either via LinkedIn or the email address above, explaining why you want access and for how long and I will set that up for you. Thanks for your understanding :-)
|
26 |
+
""")
|
src/st_helpers.py
CHANGED
@@ -20,7 +20,7 @@ def login(pw: str) -> bool:
|
|
20 |
return False
|
21 |
|
22 |
|
23 |
-
def st_setup(page_title: str, layout: str = 'wide'):
|
24 |
"""
|
25 |
Sets up standard outline (wide layout), checks for logged in status and then
|
26 |
displays the login box if not logged in. Should be used as a conditional to display
|
@@ -37,6 +37,9 @@ def st_setup(page_title: str, layout: str = 'wide'):
|
|
37 |
with st.sidebar:
|
38 |
st.image('img/uob-logo.png', width=200)
|
39 |
|
|
|
|
|
|
|
40 |
# Option to add a running_local key to secrets.toml for local login to speed up development
|
41 |
# This relies on the protection of streamlit secrets in production, which password login already relies on
|
42 |
running_local = 'running_local'
|
|
|
20 |
return False
|
21 |
|
22 |
|
23 |
+
def st_setup(page_title: str, layout: str = 'wide', skip_login: bool = False):
|
24 |
"""
|
25 |
Sets up standard outline (wide layout), checks for logged in status and then
|
26 |
displays the login box if not logged in. Should be used as a conditional to display
|
|
|
37 |
with st.sidebar:
|
38 |
st.image('img/uob-logo.png', width=200)
|
39 |
|
40 |
+
if skip_login:
|
41 |
+
return True
|
42 |
+
|
43 |
# Option to add a running_local key to secrets.toml for local login to speed up development
|
44 |
# This relies on the protection of streamlit secrets in production, which password login already relies on
|
45 |
running_local = 'running_local'
|