About section enhanced
Browse files
app.py
CHANGED
@@ -4,11 +4,12 @@ import tokonomics
|
|
4 |
from utils import create_model_hierarchy
|
5 |
from utils_on import analyze_hf_model # New import for On Premise Estimator functionality
|
6 |
|
7 |
-
st.set_page_config(page_title="LLM Pricing
|
8 |
|
9 |
# --------------------------
|
10 |
# Async Data Loading Function
|
11 |
# --------------------------
|
|
|
12 |
async def load_data():
|
13 |
"""Simulate loading data asynchronously."""
|
14 |
AVAILABLE_MODELS = await tokonomics.get_available_models()
|
@@ -123,16 +124,16 @@ def format_analysis_report(analysis_result: dict) -> str:
|
|
123 |
lines.append("- None found")
|
124 |
lines.append(f"\n**Largest Compatible GPU:** {analysis_result.get('largest_compatible_gpu', 'N/A')}\n")
|
125 |
|
126 |
-
gpu_perf = analysis_result.get("gpu_performance", {})
|
127 |
-
if gpu_perf:
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
else:
|
135 |
-
|
136 |
|
137 |
return "\n".join(lines)
|
138 |
|
@@ -203,7 +204,7 @@ elif page == "On Premise Estimator":
|
|
203 |
st.divider()
|
204 |
st.header("On Premise Estimator")
|
205 |
st.markdown("Enter a Hugging Face model ID to perform an on premise analysis using the provided estimator.")
|
206 |
-
hf_model_id = st.text_input("Hugging Face Model ID", value="
|
207 |
|
208 |
if st.button("Analyze Model"):
|
209 |
with st.spinner("Analyzing model..."):
|
@@ -225,7 +226,7 @@ elif page == "About":
|
|
225 |
- The app downloads the latest pricing from the LiteLLM repository.
|
226 |
- Using simple maths to estimate the total tokens.
|
227 |
- Helps you estimate hardware requirements for running open-source large language models (LLMs) on-premise using only the model ID from Hugging Face.
|
228 |
-
- Version 0.1
|
229 |
|
230 |
---
|
231 |
|
@@ -233,8 +234,9 @@ elif page == "About":
|
|
233 |
|
234 |
| Version | Release Date | Key Feature Updates |
|
235 |
|--------|--------------|---------------------|
|
|
|
236 |
| `v1.0` | 2025-03-26 | Initial release with basic total tokens estimation |
|
237 |
-
|
238 |
|
239 |
---
|
240 |
|
@@ -242,9 +244,12 @@ elif page == "About":
|
|
242 |
"""
|
243 |
)
|
244 |
st.markdown(
|
245 |
-
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
-
This app is for demonstration purposes only. Actual costs may vary based on usage patterns and other factors.
|
249 |
-
"""
|
250 |
-
)
|
|
|
4 |
from utils import create_model_hierarchy
|
5 |
from utils_on import analyze_hf_model # New import for On Premise Estimator functionality
|
6 |
|
7 |
+
st.set_page_config(page_title="LLM Pricing Calculator", layout="wide")
|
8 |
|
9 |
# --------------------------
|
10 |
# Async Data Loading Function
|
11 |
# --------------------------
|
12 |
+
|
13 |
async def load_data():
|
14 |
"""Simulate loading data asynchronously."""
|
15 |
AVAILABLE_MODELS = await tokonomics.get_available_models()
|
|
|
124 |
lines.append("- None found")
|
125 |
lines.append(f"\n**Largest Compatible GPU:** {analysis_result.get('largest_compatible_gpu', 'N/A')}\n")
|
126 |
|
127 |
+
#gpu_perf = analysis_result.get("gpu_performance", {})
|
128 |
+
#if gpu_perf:
|
129 |
+
# lines.append("#### GPU Performance:")
|
130 |
+
# for gpu, perf in gpu_perf.items():
|
131 |
+
# lines.append(f"**{gpu}:**")
|
132 |
+
# lines.append(f" - Tokens per Second: {perf.get('tokens_per_second', 0):.2f}")
|
133 |
+
# lines.append(f" - FLOPs per Token: {perf.get('flops_per_token', 0):.2f}")
|
134 |
+
# lines.append(f" - Effective TFLOPS: {perf.get('effective_tflops', 0):.2f}\n")
|
135 |
+
#else:
|
136 |
+
# lines.append("#### GPU Performance: N/A\n")
|
137 |
|
138 |
return "\n".join(lines)
|
139 |
|
|
|
204 |
st.divider()
|
205 |
st.header("On Premise Estimator")
|
206 |
st.markdown("Enter a Hugging Face model ID to perform an on premise analysis using the provided estimator.")
|
207 |
+
hf_model_id = st.text_input("Hugging Face Model ID", value="meta-llama/Llama-4-Scout-17B-16E")
|
208 |
|
209 |
if st.button("Analyze Model"):
|
210 |
with st.spinner("Analyzing model..."):
|
|
|
226 |
- The app downloads the latest pricing from the LiteLLM repository.
|
227 |
- Using simple maths to estimate the total tokens.
|
228 |
- Helps you estimate hardware requirements for running open-source large language models (LLMs) on-premise using only the model ID from Hugging Face.
|
229 |
+
- Latest Version 0.1
|
230 |
|
231 |
---
|
232 |
|
|
|
234 |
|
235 |
| Version | Release Date | Key Feature Updates |
|
236 |
|--------|--------------|---------------------|
|
237 |
+
| `v1.1` | 2025-04-06 | Added On Premise Estimator Feature |
|
238 |
| `v1.0` | 2025-03-26 | Initial release with basic total tokens estimation |
|
239 |
+
|
240 |
|
241 |
---
|
242 |
|
|
|
244 |
"""
|
245 |
)
|
246 |
st.markdown(
|
247 |
+
"""
|
248 |
+
### Found a Bug?
|
249 |
+
|
250 |
+
If you encounter any issues or have feedback, please email to **[email protected]**
|
251 |
+
|
252 |
+
Your input helps us improve the app!
|
253 |
+
"""
|
254 |
+
)
|
255 |
|
|
|
|
|
|