mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-02 08:44:44 +00:00
navigation
This commit is contained in:
parent
06b9566eb6
commit
114595ce71
7 changed files with 148 additions and 6 deletions
|
@ -28,16 +28,52 @@ def main():
|
||||||
rag_page = st.Page("page/playground/rag.py", title="RAG", icon="💬", default=False)
|
rag_page = st.Page("page/playground/rag.py", title="RAG", icon="💬", default=False)
|
||||||
|
|
||||||
# Distribution pages
|
# Distribution pages
|
||||||
distribution_page = st.Page(
|
provider_page = st.Page(
|
||||||
"page/distribution/distro.py", title="Distribution", icon="🔍", default=False
|
"page/distribution/providers.py", title="Provider", icon="🔍", default=False
|
||||||
|
)
|
||||||
|
model_page = st.Page(
|
||||||
|
"page/distribution/models.py", title="Models", icon="🔍", default=False
|
||||||
|
)
|
||||||
|
memory_bank_page = st.Page(
|
||||||
|
"page/distribution/memory_banks.py",
|
||||||
|
title="Memory Banks",
|
||||||
|
icon="🔍",
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
|
shield_page = st.Page(
|
||||||
|
"page/distribution/shields.py", title="Shields", icon="🔍", default=False
|
||||||
|
)
|
||||||
|
scoring_function_page = st.Page(
|
||||||
|
"page/distribution/scoring_functions.py",
|
||||||
|
title="Scoring Functions",
|
||||||
|
icon="🔍",
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
|
eval_task_page = st.Page(
|
||||||
|
"page/distribution/eval_tasks.py",
|
||||||
|
title="Eval Tasks",
|
||||||
|
icon="🔍",
|
||||||
|
default=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
pg = st.navigation(
|
pg = st.navigation(
|
||||||
{
|
{
|
||||||
"Evaluations": [application_evaluation_page, native_evaluation_page],
|
"Playground": [
|
||||||
"Playground": [chat_page, rag_page],
|
chat_page,
|
||||||
"Distribution": [distribution_page],
|
rag_page,
|
||||||
}
|
application_evaluation_page,
|
||||||
|
native_evaluation_page,
|
||||||
|
],
|
||||||
|
"Inspect": [
|
||||||
|
provider_page,
|
||||||
|
model_page,
|
||||||
|
memory_bank_page,
|
||||||
|
shield_page,
|
||||||
|
scoring_function_page,
|
||||||
|
eval_task_page,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
expanded=False,
|
||||||
)
|
)
|
||||||
pg.run()
|
pg.run()
|
||||||
|
|
||||||
|
|
18
llama_stack/distribution/ui/page/distribution/eval_tasks.py
Normal file
18
llama_stack/distribution/ui/page/distribution/eval_tasks.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import streamlit as st
|
||||||
|
from modules.api import llama_stack_api
|
||||||
|
|
||||||
|
# Eval Tasks Section
|
||||||
|
st.header("Eval Tasks")
|
||||||
|
|
||||||
|
eval_tasks_info = {
|
||||||
|
d.identifier: d.to_dict() for d in llama_stack_api.client.eval_tasks.list()
|
||||||
|
}
|
||||||
|
|
||||||
|
selected_eval_task = st.selectbox("Select an eval task", list(eval_tasks_info.keys()))
|
||||||
|
st.json(eval_tasks_info[selected_eval_task], expanded=True)
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import streamlit as st
|
||||||
|
from modules.api import llama_stack_api
|
||||||
|
|
||||||
|
st.header("Memory Banks")
|
||||||
|
memory_banks_info = {
|
||||||
|
m.identifier: m.to_dict() for m in llama_stack_api.client.memory_banks.list()
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(memory_banks_info) > 0:
|
||||||
|
selected_memory_bank = st.selectbox(
|
||||||
|
"Select a memory bank", list(memory_banks_info.keys())
|
||||||
|
)
|
||||||
|
st.json(memory_banks_info[selected_memory_bank])
|
||||||
|
else:
|
||||||
|
st.info("No memory banks found")
|
15
llama_stack/distribution/ui/page/distribution/models.py
Normal file
15
llama_stack/distribution/ui/page/distribution/models.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import streamlit as st
|
||||||
|
from modules.api import llama_stack_api
|
||||||
|
|
||||||
|
# Models Section
|
||||||
|
st.header("Models")
|
||||||
|
models_info = {m.identifier: m.to_dict() for m in llama_stack_api.client.models.list()}
|
||||||
|
|
||||||
|
selected_model = st.selectbox("Select a model", list(models_info.keys()))
|
||||||
|
st.json(models_info[selected_model])
|
15
llama_stack/distribution/ui/page/distribution/providers.py
Normal file
15
llama_stack/distribution/ui/page/distribution/providers.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import streamlit as st
|
||||||
|
from modules.api import llama_stack_api
|
||||||
|
|
||||||
|
st.header("API Providers")
|
||||||
|
apis_providers_info = llama_stack_api.client.providers.list()
|
||||||
|
# selected_api = st.selectbox("Select an API", list(apis_providers_info.keys()))
|
||||||
|
for api in apis_providers_info.keys():
|
||||||
|
st.markdown(f"###### {api}")
|
||||||
|
st.dataframe([p.to_dict() for p in apis_providers_info[api]], width=500)
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import streamlit as st
|
||||||
|
from modules.api import llama_stack_api
|
||||||
|
|
||||||
|
st.header("Scoring Functions")
|
||||||
|
|
||||||
|
scoring_functions_info = {
|
||||||
|
s.identifier: s.to_dict() for s in llama_stack_api.client.scoring_functions.list()
|
||||||
|
}
|
||||||
|
|
||||||
|
selected_scoring_function = st.selectbox(
|
||||||
|
"Select a scoring function", list(scoring_functions_info.keys())
|
||||||
|
)
|
||||||
|
st.json(scoring_functions_info[selected_scoring_function], expanded=True)
|
18
llama_stack/distribution/ui/page/distribution/shields.py
Normal file
18
llama_stack/distribution/ui/page/distribution/shields.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the terms described in the LICENSE file in
|
||||||
|
# the root directory of this source tree.
|
||||||
|
|
||||||
|
import streamlit as st
|
||||||
|
from modules.api import llama_stack_api
|
||||||
|
|
||||||
|
# Shields Section
|
||||||
|
st.header("Shields")
|
||||||
|
|
||||||
|
shields_info = {
|
||||||
|
s.identifier: s.to_dict() for s in llama_stack_api.client.shields.list()
|
||||||
|
}
|
||||||
|
|
||||||
|
selected_shield = st.selectbox("Select a shield", list(shields_info.keys()))
|
||||||
|
st.json(shields_info[selected_shield])
|
Loading…
Add table
Add a link
Reference in a new issue