mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 15:49:49 +00:00
100 lines
2.8 KiB
Markdown
100 lines
2.8 KiB
Markdown
# Playground UI
|
|
|
|
```{note}
|
|
Playground UI is currently experimental and subject to change. We welcome feedback and contributions to help improve it.
|
|
```
|
|
|
|
Llama Stack Playground UI is an simple interface aims to:
|
|
- Showcase **capabilities** and **concepts** of Llama Stack in an interactive environment
|
|
- Demo **end-to-end** application code to help users get started to build their own applications
|
|
- Provide an **UI** to help users inspect and analyze Llama Stack API providers and resources
|
|
|
|
## Key Features
|
|
|
|
#### Playground
|
|
Interactive pages for users to play with and explore Llama Stack API capabilities.
|
|
|
|
##### Chatbot
|
|
```{eval-rst}
|
|
.. video:: https://github.com/user-attachments/assets/6ca617e8-32ca-49b2-9774-185020ff5204
|
|
:autoplay:
|
|
:playsinline:
|
|
:muted:
|
|
:loop:
|
|
:width: 100%
|
|
```
|
|
- **Chat**: Chat with Llama models
|
|
- **RAG**: Uploading documents to memory_banks and chat with RAG agent
|
|
|
|
##### Evaluations
|
|
```{eval-rst}
|
|
.. video:: https://github.com/user-attachments/assets/6cc1659f-eba4-49ca-a0a5-7c243557b4f5
|
|
:autoplay:
|
|
:playsinline:
|
|
:muted:
|
|
:loop:
|
|
:width: 100%
|
|
```
|
|
- **Evaluations (Scoring)**: Run evaluations on your AI application datasets
|
|
|
|
|
|
```{eval-rst}
|
|
.. video:: https://github.com/user-attachments/assets/345845c7-2a2b-4095-960a-9ae40f6a93cf
|
|
:autoplay:
|
|
:playsinline:
|
|
:muted:
|
|
:loop:
|
|
:width: 100%
|
|
```
|
|
- **Evaluations (Generation + Scoring)**: Use pre-registered evaluation tasks to evaluate an model or agent candidate
|
|
|
|
|
|
|
|
|
|
##### Inspect
|
|
```{eval-rst}
|
|
.. video:: https://github.com/user-attachments/assets/01d52b2d-92af-4e3a-b623-a9b8ba22ba99
|
|
:autoplay:
|
|
:playsinline:
|
|
:muted:
|
|
:loop:
|
|
:width: 100%
|
|
```
|
|
- **Inspect** Llama Stack API providers and resources (models, datasets, memory_banks, eval_tasks, etc).
|
|
|
|
|
|
## Starting the Playground UI
|
|
|
|
To start the Playground UI, run the following commands:
|
|
|
|
1. Start up the Llama Stack API server
|
|
|
|
```bash
|
|
llama stack build --template together --image-type conda
|
|
llama stack run together
|
|
```
|
|
|
|
2. (Optional) Register datasets and eval tasks as resources. If you want to run pre-configured evaluation flows (e.g. Evaluations (Generation + Scoring) Page).
|
|
```bash
|
|
$ llama-stack-client datasets register \
|
|
--dataset-id "mmlu" \
|
|
--provider-id "huggingface" \
|
|
--url "https://huggingface.co/datasets/llamastack/evals" \
|
|
--metadata '{"path": "llamastack/evals", "name": "evals__mmlu__details", "split": "train"}' \
|
|
--schema '{"input_query": {"type": "string"}, "expected_answer": {"type": "string", "chat_completion_input": {"type": "string"}}}'
|
|
```
|
|
|
|
```bash
|
|
$ llama-stack-client eval_tasks register \
|
|
--eval-task-id meta-reference-mmlu \
|
|
--provider-id meta-reference \
|
|
--dataset-id mmlu \
|
|
--scoring-functions basic::regex_parser_multiple_choice_answer
|
|
```
|
|
|
|
3. Start Streamlit UI
|
|
```bash
|
|
cd llama_stack/distribution/ui
|
|
pip install -r requirements.txt
|
|
streamlit run app.py
|
|
```
|