diff --git a/parlance/views.py b/parlance/views.py index 2a2c5cf..ef2e175 100644 --- a/parlance/views.py +++ b/parlance/views.py @@ -19,6 +19,7 @@ from django.shortcuts import render from django.views.generic import TemplateView +from parley.models import LLM, Evaluation, Prompt, Response ########################################################################## @@ -32,6 +33,17 @@ class Dashboard(TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['page_id'] = "dashboard" + + # Get statistics for stat cards + context['n_llms'] = LLM.objects.count() + context["n_evaluations"] = Evaluation.objects.count() + context["n_prompts"] = Prompt.objects.count() + context["n_responses"] = Response.objects.count() + + # Get evaluations and models + context["evaluations"] = Evaluation.objects.filter(active=True) + context["llms"] = LLM.objects.all()[:20] + return context diff --git a/templates/components/statcard.html b/templates/components/statcard.html new file mode 100644 index 0000000..90b03ad --- /dev/null +++ b/templates/components/statcard.html @@ -0,0 +1,22 @@ +
+
+
+
+ + +
+ {{ title }} +
+ + + {{ value }} + +
+ +
+ +
+ +
+
+
\ No newline at end of file diff --git a/templates/site/dashboard.html b/templates/site/dashboard.html index 4d2be11..6b860ac 100644 --- a/templates/site/dashboard.html +++ b/templates/site/dashboard.html @@ -19,9 +19,7 @@

- - Create Report - +
@@ -32,6 +30,141 @@

{% block page %}
+ + +
+
+ {% include "components/statcard.html" with title="LLMs" value=n_llms icon="fe-cpu" %} +
+
+ {% include "components/statcard.html" with title="Evaluations" value=n_evaluations icon="fe-clipboard" %} +
+
+ {% include "components/statcard.html" with title="Prompts" value=n_prompts icon="fe-file-plus" %} +
+
+ {% include "components/statcard.html" with title="Responses" value=n_responses icon="fe-message-square" %} +
+
+ + +
+
+ +
+
+

+ Active Evaluations +

+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+

LLM Models

+
+ +
+ + + + + + + + + + {% for model in llms %} + + + + + + {% endfor %} + +
NameTypeResponses
{{model.name}} v{{ model.version }}{% if model.is_adapter_model %}LoRA{% else %}Base{% endif %}{{model.responses.count}}
+
+
+ +
+
{% endblock %} {% endblock %} \ No newline at end of file