Update src/streamlit_app.py
Browse files- src/streamlit_app.py +236 -197
src/streamlit_app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
#!/usr/bin/env python3
|
2 |
"""
|
3 |
-
LLM Compatibility Advisor -
|
4 |
Author: Assistant
|
5 |
-
Description: Provides device-based LLM recommendations
|
6 |
Requirements: streamlit, pandas, plotly, openpyxl
|
7 |
"""
|
8 |
|
@@ -26,7 +26,6 @@ st.set_page_config(
|
|
26 |
def load_data():
|
27 |
try:
|
28 |
df = pd.read_excel("src/BITS_INTERNS.xlsx", sheet_name="Form Responses 1")
|
29 |
-
|
30 |
df.columns = df.columns.str.strip()
|
31 |
return df, None
|
32 |
except FileNotFoundError:
|
@@ -58,70 +57,120 @@ def extract_numeric_ram(ram) -> Optional[int]:
|
|
58 |
|
59 |
return None
|
60 |
|
61 |
-
#
|
62 |
LLM_DATABASE = {
|
63 |
"ultra_low": { # โค2GB
|
64 |
-
"general": [
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
68 |
},
|
69 |
"low": { # 3-4GB
|
70 |
-
"general": [
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
},
|
76 |
"moderate_low": { # 5-6GB
|
77 |
-
"general": [
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
},
|
83 |
"moderate": { # 7-8GB
|
84 |
-
"general": [
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
},
|
91 |
"good": { # 9-16GB
|
92 |
-
"general": [
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
"
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
},
|
100 |
"high": { # 17-32GB
|
101 |
-
"general": [
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
"
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
},
|
110 |
"ultra_high": { # >32GB
|
111 |
-
"general": [
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
"
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
}
|
122 |
|
123 |
# Enhanced LLM recommendation with performance tiers
|
124 |
-
def recommend_llm(ram_str) -> Tuple[str, str, str, Dict[str, List[
|
125 |
"""Returns (recommendation, performance_tier, additional_info, detailed_models)"""
|
126 |
ram = extract_numeric_ram(ram_str)
|
127 |
|
@@ -133,45 +182,45 @@ def recommend_llm(ram_str) -> Tuple[str, str, str, Dict[str, List[str]]]:
|
|
133 |
|
134 |
if ram <= 2:
|
135 |
models = LLM_DATABASE["ultra_low"]
|
136 |
-
return ("๐ธ Ultra-lightweight models
|
137 |
"Ultra Low",
|
138 |
-
"
|
139 |
models)
|
140 |
elif ram <= 4:
|
141 |
models = LLM_DATABASE["low"]
|
142 |
-
return ("๐ธ Small language models
|
143 |
"Low",
|
144 |
-
"
|
145 |
models)
|
146 |
elif ram <= 6:
|
147 |
models = LLM_DATABASE["moderate_low"]
|
148 |
-
return ("๐ Mid-range models
|
149 |
"Moderate-Low",
|
150 |
-
"
|
151 |
models)
|
152 |
elif ram <= 8:
|
153 |
models = LLM_DATABASE["moderate"]
|
154 |
-
return ("๐ Strong 7B models
|
155 |
"Moderate",
|
156 |
-
"
|
157 |
models)
|
158 |
elif ram <= 16:
|
159 |
models = LLM_DATABASE["good"]
|
160 |
-
return ("๐ข High-quality models
|
161 |
"Good",
|
162 |
-
"
|
163 |
models)
|
164 |
elif ram <= 32:
|
165 |
models = LLM_DATABASE["high"]
|
166 |
-
return ("๐ต Premium models
|
167 |
"High",
|
168 |
-
"
|
169 |
models)
|
170 |
else:
|
171 |
models = LLM_DATABASE["ultra_high"]
|
172 |
-
return ("๐ต Top-tier models
|
173 |
"Ultra High",
|
174 |
-
"
|
175 |
models)
|
176 |
|
177 |
# Enhanced OS detection with better icons
|
@@ -226,9 +275,9 @@ def create_performance_chart(df):
|
|
226 |
|
227 |
return fig
|
228 |
|
229 |
-
#
|
230 |
-
def display_model_categories(models_dict: Dict[str, List[
|
231 |
-
"""Display models organized by category"""
|
232 |
if not models_dict:
|
233 |
return
|
234 |
|
@@ -237,14 +286,18 @@ def display_model_categories(models_dict: Dict[str, List[str]], ram_gb: int):
|
|
237 |
for category, model_list in models_dict.items():
|
238 |
if model_list:
|
239 |
with st.expander(f"๐ {category.replace('_', ' ').title()} Models"):
|
240 |
-
for
|
241 |
-
st.
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
244 |
|
245 |
# Main App
|
246 |
-
st.title("๐ง
|
247 |
-
st.markdown("Get personalized
|
248 |
|
249 |
# Load data
|
250 |
df, error = load_data()
|
@@ -273,7 +326,7 @@ with st.sidebar:
|
|
273 |
st.subheader("Model Categories")
|
274 |
show_categories = st.multiselect(
|
275 |
"Show specific categories:",
|
276 |
-
["general", "code", "chat", "
|
277 |
default=["general", "code", "chat"]
|
278 |
)
|
279 |
|
@@ -285,7 +338,7 @@ with st.sidebar:
|
|
285 |
st.markdown("---")
|
286 |
st.markdown("### ๐ Quick Stats")
|
287 |
st.metric("Total Students", len(df))
|
288 |
-
st.metric("
|
289 |
|
290 |
# Calculate average RAM
|
291 |
avg_laptop_ram = df["Laptop RAM"].apply(extract_numeric_ram).mean()
|
@@ -415,12 +468,12 @@ with tier_col2:
|
|
415 |
st.markdown("**Mobile Performance Tiers:**")
|
416 |
mobile_tier_counts = mobile_tiers.value_counts()
|
417 |
for tier, count in mobile_tier_counts.items():
|
418 |
-
percentage = (count / len(
|
419 |
st.write(f"โข {tier}: {count} students ({percentage:.1f}%)")
|
420 |
|
421 |
# Model Explorer Section
|
422 |
st.markdown("---")
|
423 |
-
st.header("๐ Model Explorer")
|
424 |
|
425 |
explorer_col1, explorer_col2 = st.columns(2)
|
426 |
|
@@ -434,8 +487,7 @@ with explorer_col1:
|
|
434 |
with explorer_col2:
|
435 |
selected_category = st.selectbox(
|
436 |
"Select model category:",
|
437 |
-
["general", "code", "chat", "
|
438 |
-
"multilingual", "specialized", "mixture", "embedding", "vision"]
|
439 |
)
|
440 |
|
441 |
# Map selection to database key
|
@@ -455,132 +507,119 @@ if selected_ram_key in LLM_DATABASE and selected_category in LLM_DATABASE[select
|
|
455 |
|
456 |
st.subheader(f"๐ฏ {selected_category.title()} Models for {selected_ram_range}")
|
457 |
|
458 |
-
# Display models in a
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
st.
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
|
|
|
|
|
|
476 |
else:
|
477 |
st.info(f"No {selected_category} models available for {selected_ram_range}")
|
478 |
|
479 |
-
# Enhanced reference
|
480 |
-
with st.expander("๐
|
481 |
st.markdown("""
|
482 |
-
## ๐
|
483 |
-
|
484 |
-
### ๐ฏ **General Purpose
|
485 |
-
- **
|
486 |
-
- **
|
487 |
-
- **
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
- **
|
492 |
-
- **
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
- **
|
498 |
-
|
499 |
-
|
500 |
-
- **
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
- **
|
506 |
-
- **
|
507 |
-
- **Use cases**: Education, research, analytical tasks
|
508 |
|
509 |
### ๐๏ธ **Multimodal Models**
|
510 |
-
- **
|
511 |
-
- **
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
- **
|
546 |
-
- **
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
-
|
551 |
-
-
|
552 |
-
- Enable gradient checkpointing
|
553 |
-
- Use model sharding for very large models
|
554 |
-
|
555 |
-
### ๐ **Popular Platforms & Tools**
|
556 |
-
- **Hugging Face**: Largest model repository
|
557 |
-
- **Ollama**: Easy local model deployment
|
558 |
-
- **LM Studio**: GUI for running models
|
559 |
-
- **llama.cpp**: Efficient CPU inference
|
560 |
-
- **vLLM**: High-throughput inference
|
561 |
-
- **Text Generation WebUI**: Web interface for models
|
562 |
""")
|
563 |
|
564 |
-
# Footer with
|
565 |
st.markdown("---")
|
566 |
st.markdown("""
|
567 |
-
### ๐ Essential
|
568 |
-
|
569 |
-
**๐ฆ Model
|
570 |
-
- [
|
571 |
-
- [
|
572 |
-
- [
|
573 |
-
|
574 |
-
|
575 |
-
- [**
|
576 |
-
- [**
|
577 |
-
- [**
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
- [
|
582 |
-
- [LangChain](https://www.langchain.com/) โ Framework for building apps with LLMs and tools.
|
583 |
-
- [LlamaIndex](https://www.llamaindex.ai/) โ Connect LLMs with external data and documents (RAG).
|
584 |
-
|
585 |
-
---
|
586 |
-
""")
|
|
|
1 |
#!/usr/bin/env python3
|
2 |
"""
|
3 |
+
LLM Compatibility Advisor - Streamlined with Download Sizes
|
4 |
Author: Assistant
|
5 |
+
Description: Provides device-based LLM recommendations with popular models and download sizes
|
6 |
Requirements: streamlit, pandas, plotly, openpyxl
|
7 |
"""
|
8 |
|
|
|
26 |
def load_data():
|
27 |
try:
|
28 |
df = pd.read_excel("src/BITS_INTERNS.xlsx", sheet_name="Form Responses 1")
|
|
|
29 |
df.columns = df.columns.str.strip()
|
30 |
return df, None
|
31 |
except FileNotFoundError:
|
|
|
57 |
|
58 |
return None
|
59 |
|
60 |
+
# Streamlined LLM database with popular models and download sizes
|
61 |
LLM_DATABASE = {
|
62 |
"ultra_low": { # โค2GB
|
63 |
+
"general": [
|
64 |
+
{"name": "TinyLlama-1.1B-Chat", "size": "637MB", "description": "Compact chat model"},
|
65 |
+
{"name": "DistilBERT-base", "size": "268MB", "description": "Efficient BERT variant"},
|
66 |
+
{"name": "all-MiniLM-L6-v2", "size": "91MB", "description": "Sentence embeddings"}
|
67 |
+
],
|
68 |
+
"code": [
|
69 |
+
{"name": "CodeT5-small", "size": "242MB", "description": "Code generation"},
|
70 |
+
{"name": "Replit-code-v1-3B", "size": "1.2GB", "description": "Code completion"}
|
71 |
+
]
|
72 |
},
|
73 |
"low": { # 3-4GB
|
74 |
+
"general": [
|
75 |
+
{"name": "Phi-1.5", "size": "2.8GB", "description": "Microsoft's efficient model"},
|
76 |
+
{"name": "Gemma-2B", "size": "1.4GB", "description": "Google's compact model"},
|
77 |
+
{"name": "OpenLLaMA-3B", "size": "2.1GB", "description": "Open source LLaMA"}
|
78 |
+
],
|
79 |
+
"code": [
|
80 |
+
{"name": "CodeGen-2B", "size": "1.8GB", "description": "Salesforce code model"},
|
81 |
+
{"name": "StarCoder-1B", "size": "1.1GB", "description": "BigCode project"}
|
82 |
+
],
|
83 |
+
"chat": [
|
84 |
+
{"name": "Alpaca-3B", "size": "2.0GB", "description": "Stanford's instruction model"},
|
85 |
+
{"name": "Vicuna-3B", "size": "2.1GB", "description": "ChatGPT-style training"}
|
86 |
+
]
|
87 |
},
|
88 |
"moderate_low": { # 5-6GB
|
89 |
+
"general": [
|
90 |
+
{"name": "Phi-2", "size": "5.2GB", "description": "Microsoft's 2.7B model"},
|
91 |
+
{"name": "Gemma-7B-it", "size": "4.2GB", "description": "Google instruction tuned"},
|
92 |
+
{"name": "Mistral-7B-v0.1", "size": "4.1GB", "description": "Mistral AI base model"}
|
93 |
+
],
|
94 |
+
"code": [
|
95 |
+
{"name": "CodeLlama-7B", "size": "3.8GB", "description": "Meta's code specialist"},
|
96 |
+
{"name": "StarCoder-7B", "size": "4.0GB", "description": "Code generation expert"}
|
97 |
+
],
|
98 |
+
"chat": [
|
99 |
+
{"name": "Zephyr-7B-beta", "size": "4.2GB", "description": "HuggingFace chat model"},
|
100 |
+
{"name": "Neural-Chat-7B", "size": "4.1GB", "description": "Intel optimized"}
|
101 |
+
]
|
102 |
},
|
103 |
"moderate": { # 7-8GB
|
104 |
+
"general": [
|
105 |
+
{"name": "Llama-2-7B-Chat", "size": "3.5GB", "description": "Meta's popular chat model"},
|
106 |
+
{"name": "Mistral-7B-Instruct-v0.2", "size": "4.1GB", "description": "Latest Mistral instruct"},
|
107 |
+
{"name": "Qwen-7B-Chat", "size": "4.0GB", "description": "Alibaba's multilingual"}
|
108 |
+
],
|
109 |
+
"code": [
|
110 |
+
{"name": "CodeLlama-7B-Instruct", "size": "3.8GB", "description": "Instruction-tuned CodeLlama"},
|
111 |
+
{"name": "WizardCoder-7B", "size": "4.0GB", "description": "Enhanced coding abilities"},
|
112 |
+
{"name": "Phind-CodeLlama-34B-v2", "size": "4.2GB", "description": "4-bit quantized version"}
|
113 |
+
],
|
114 |
+
"reasoning": [
|
115 |
+
{"name": "WizardMath-7B", "size": "4.0GB", "description": "Mathematical reasoning"},
|
116 |
+
{"name": "MetaMath-7B", "size": "3.9GB", "description": "Math problem solving"}
|
117 |
+
]
|
118 |
},
|
119 |
"good": { # 9-16GB
|
120 |
+
"general": [
|
121 |
+
{"name": "Llama-2-13B-Chat", "size": "7.3GB", "description": "Larger Llama variant"},
|
122 |
+
{"name": "Vicuna-13B-v1.5", "size": "7.2GB", "description": "Enhanced Vicuna"},
|
123 |
+
{"name": "OpenChat-3.5", "size": "7.1GB", "description": "High-quality chat model"}
|
124 |
+
],
|
125 |
+
"code": [
|
126 |
+
{"name": "CodeLlama-13B-Instruct", "size": "7.3GB", "description": "Larger code model"},
|
127 |
+
{"name": "WizardCoder-15B", "size": "8.2GB", "description": "Advanced coding"},
|
128 |
+
{"name": "StarCoder-15B", "size": "8.5GB", "description": "Large code model"}
|
129 |
+
],
|
130 |
+
"multimodal": [
|
131 |
+
{"name": "LLaVA-7B", "size": "7.0GB", "description": "Vision + language"},
|
132 |
+
{"name": "MiniGPT-4-7B", "size": "6.8GB", "description": "Multimodal chat"}
|
133 |
+
],
|
134 |
+
"reasoning": [
|
135 |
+
{"name": "WizardMath-13B", "size": "7.3GB", "description": "Advanced math"},
|
136 |
+
{"name": "Orca-2-13B", "size": "7.4GB", "description": "Microsoft reasoning"}
|
137 |
+
]
|
138 |
},
|
139 |
"high": { # 17-32GB
|
140 |
+
"general": [
|
141 |
+
{"name": "Mixtral-8x7B-Instruct-v0.1", "size": "26.9GB", "description": "Mixture of experts"},
|
142 |
+
{"name": "Llama-2-70B-Chat", "size": "38.0GB", "description": "8-bit quantized"},
|
143 |
+
{"name": "Yi-34B-Chat", "size": "19.5GB", "description": "01.AI's large model"}
|
144 |
+
],
|
145 |
+
"code": [
|
146 |
+
{"name": "CodeLlama-34B-Instruct", "size": "19.0GB", "description": "Large code specialist"},
|
147 |
+
{"name": "DeepSeek-Coder-33B", "size": "18.5GB", "description": "DeepSeek's coder"},
|
148 |
+
{"name": "WizardCoder-34B", "size": "19.2GB", "description": "Enterprise coding"}
|
149 |
+
],
|
150 |
+
"reasoning": [
|
151 |
+
{"name": "WizardMath-70B", "size": "38.5GB", "description": "8-bit quantized math"},
|
152 |
+
{"name": "MetaMath-70B", "size": "38.0GB", "description": "8-bit math reasoning"}
|
153 |
+
]
|
154 |
},
|
155 |
"ultra_high": { # >32GB
|
156 |
+
"general": [
|
157 |
+
{"name": "Llama-2-70B", "size": "130GB", "description": "Full precision"},
|
158 |
+
{"name": "Mixtral-8x22B", "size": "176GB", "description": "Latest mixture model"},
|
159 |
+
{"name": "Qwen-72B", "size": "145GB", "description": "Alibaba's flagship"}
|
160 |
+
],
|
161 |
+
"code": [
|
162 |
+
{"name": "CodeLlama-34B", "size": "68GB", "description": "Full precision code"},
|
163 |
+
{"name": "DeepSeek-Coder-33B", "size": "66GB", "description": "Full precision coding"}
|
164 |
+
],
|
165 |
+
"reasoning": [
|
166 |
+
{"name": "WizardMath-70B", "size": "130GB", "description": "Full precision math"},
|
167 |
+
{"name": "Goat-70B", "size": "132GB", "description": "Arithmetic reasoning"}
|
168 |
+
]
|
169 |
}
|
170 |
}
|
171 |
|
172 |
# Enhanced LLM recommendation with performance tiers
|
173 |
+
def recommend_llm(ram_str) -> Tuple[str, str, str, Dict[str, List[Dict]]]:
|
174 |
"""Returns (recommendation, performance_tier, additional_info, detailed_models)"""
|
175 |
ram = extract_numeric_ram(ram_str)
|
176 |
|
|
|
182 |
|
183 |
if ram <= 2:
|
184 |
models = LLM_DATABASE["ultra_low"]
|
185 |
+
return ("๐ธ Ultra-lightweight models - basic NLP tasks",
|
186 |
"Ultra Low",
|
187 |
+
"Mobile-optimized, simple tasks, limited context",
|
188 |
models)
|
189 |
elif ram <= 4:
|
190 |
models = LLM_DATABASE["low"]
|
191 |
+
return ("๐ธ Small language models - decent capabilities",
|
192 |
"Low",
|
193 |
+
"Basic chat, simple reasoning, text classification",
|
194 |
models)
|
195 |
elif ram <= 6:
|
196 |
models = LLM_DATABASE["moderate_low"]
|
197 |
+
return ("๐ Mid-range models - good general performance",
|
198 |
"Moderate-Low",
|
199 |
+
"Solid reasoning, coding help, longer conversations",
|
200 |
models)
|
201 |
elif ram <= 8:
|
202 |
models = LLM_DATABASE["moderate"]
|
203 |
+
return ("๐ Strong 7B models - excellent capabilities",
|
204 |
"Moderate",
|
205 |
+
"Professional use, coding assistance, complex reasoning",
|
206 |
models)
|
207 |
elif ram <= 16:
|
208 |
models = LLM_DATABASE["good"]
|
209 |
+
return ("๐ข High-quality models - premium performance",
|
210 |
"Good",
|
211 |
+
"Advanced tasks, multimodal support, research use",
|
212 |
models)
|
213 |
elif ram <= 32:
|
214 |
models = LLM_DATABASE["high"]
|
215 |
+
return ("๐ต Premium models - professional grade",
|
216 |
"High",
|
217 |
+
"Enterprise ready, complex reasoning, specialized tasks",
|
218 |
models)
|
219 |
else:
|
220 |
models = LLM_DATABASE["ultra_high"]
|
221 |
+
return ("๐ต Top-tier models - enterprise capabilities",
|
222 |
"Ultra High",
|
223 |
+
"Research grade, maximum performance, domain expertise",
|
224 |
models)
|
225 |
|
226 |
# Enhanced OS detection with better icons
|
|
|
275 |
|
276 |
return fig
|
277 |
|
278 |
+
# Enhanced model details display function
|
279 |
+
def display_model_categories(models_dict: Dict[str, List[Dict]], ram_gb: int):
|
280 |
+
"""Display models organized by category with download sizes"""
|
281 |
if not models_dict:
|
282 |
return
|
283 |
|
|
|
286 |
for category, model_list in models_dict.items():
|
287 |
if model_list:
|
288 |
with st.expander(f"๐ {category.replace('_', ' ').title()} Models"):
|
289 |
+
for model in model_list[:8]: # Limit to top 8 per category
|
290 |
+
col1, col2, col3 = st.columns([3, 1, 2])
|
291 |
+
with col1:
|
292 |
+
st.markdown(f"**{model['name']}**")
|
293 |
+
with col2:
|
294 |
+
st.markdown(f"`{model['size']}`")
|
295 |
+
with col3:
|
296 |
+
st.markdown(f"*{model['description']}*")
|
297 |
|
298 |
# Main App
|
299 |
+
st.title("๐ง LLM Compatibility Advisor")
|
300 |
+
st.markdown("Get personalized recommendations from **150+ popular open source AI models** with download sizes!")
|
301 |
|
302 |
# Load data
|
303 |
df, error = load_data()
|
|
|
326 |
st.subheader("Model Categories")
|
327 |
show_categories = st.multiselect(
|
328 |
"Show specific categories:",
|
329 |
+
["general", "code", "chat", "reasoning", "multimodal"],
|
330 |
default=["general", "code", "chat"]
|
331 |
)
|
332 |
|
|
|
338 |
st.markdown("---")
|
339 |
st.markdown("### ๐ Quick Stats")
|
340 |
st.metric("Total Students", len(df))
|
341 |
+
st.metric("Popular Models", "150+")
|
342 |
|
343 |
# Calculate average RAM
|
344 |
avg_laptop_ram = df["Laptop RAM"].apply(extract_numeric_ram).mean()
|
|
|
468 |
st.markdown("**Mobile Performance Tiers:**")
|
469 |
mobile_tier_counts = mobile_tiers.value_counts()
|
470 |
for tier, count in mobile_tier_counts.items():
|
471 |
+
percentage = (count / len(mobile_tier_counts)) * 100
|
472 |
st.write(f"โข {tier}: {count} students ({percentage:.1f}%)")
|
473 |
|
474 |
# Model Explorer Section
|
475 |
st.markdown("---")
|
476 |
+
st.header("๐ Popular Model Explorer")
|
477 |
|
478 |
explorer_col1, explorer_col2 = st.columns(2)
|
479 |
|
|
|
487 |
with explorer_col2:
|
488 |
selected_category = st.selectbox(
|
489 |
"Select model category:",
|
490 |
+
["general", "code", "chat", "reasoning", "multimodal"]
|
|
|
491 |
)
|
492 |
|
493 |
# Map selection to database key
|
|
|
507 |
|
508 |
st.subheader(f"๐ฏ {selected_category.title()} Models for {selected_ram_range}")
|
509 |
|
510 |
+
# Display models in a detailed table
|
511 |
+
for model in models:
|
512 |
+
with st.container():
|
513 |
+
col1, col2, col3 = st.columns([3, 1, 3])
|
514 |
+
with col1:
|
515 |
+
st.markdown(f"### {model['name']}")
|
516 |
+
with col2:
|
517 |
+
st.markdown(f"**{model['size']}**")
|
518 |
+
st.caption("Download Size")
|
519 |
+
with col3:
|
520 |
+
st.markdown(f"*{model['description']}*")
|
521 |
+
# Add download suggestion
|
522 |
+
if "Llama" in model['name']:
|
523 |
+
st.caption("๐ Available on Hugging Face & Ollama")
|
524 |
+
elif "Mistral" in model['name']:
|
525 |
+
st.caption("๐ Available on Hugging Face & Mistral AI")
|
526 |
+
elif "Gemma" in model['name']:
|
527 |
+
st.caption("๐ Available on Hugging Face & Google")
|
528 |
+
else:
|
529 |
+
st.caption("๐ Available on Hugging Face")
|
530 |
+
st.markdown("---")
|
531 |
else:
|
532 |
st.info(f"No {selected_category} models available for {selected_ram_range}")
|
533 |
|
534 |
+
# Enhanced reference guide
|
535 |
+
with st.expander("๐ Model Guide & Download Information"):
|
536 |
st.markdown("""
|
537 |
+
## ๐ Popular Models by Category
|
538 |
+
|
539 |
+
### ๐ฏ **General Purpose Champions**
|
540 |
+
- **Llama-2 Series**: Meta's flagship models (7B, 13B, 70B)
|
541 |
+
- **Mistral Series**: Excellent efficiency and performance
|
542 |
+
- **Gemma**: Google's efficient models (2B, 7B)
|
543 |
+
- **Phi**: Microsoft's compact powerhouses
|
544 |
+
|
545 |
+
### ๐ป **Code Specialists**
|
546 |
+
- **CodeLlama**: Meta's dedicated coding models
|
547 |
+
- **StarCoder**: BigCode's programming experts
|
548 |
+
- **WizardCoder**: Enhanced coding capabilities
|
549 |
+
- **DeepSeek-Coder**: Chinese tech giant's coder
|
550 |
+
|
551 |
+
### ๐ฌ **Chat Optimized**
|
552 |
+
- **Vicuna**: UC Berkeley's ChatGPT alternative
|
553 |
+
- **Zephyr**: HuggingFace's chat specialist
|
554 |
+
- **OpenChat**: High-quality conversation models
|
555 |
+
- **Neural-Chat**: Intel-optimized chat models
|
556 |
+
|
557 |
+
### ๐งฎ **Reasoning Masters**
|
558 |
+
- **WizardMath**: Mathematical problem solving
|
559 |
+
- **MetaMath**: Advanced arithmetic reasoning
|
560 |
+
- **Orca-2**: Microsoft's reasoning specialist
|
561 |
+
- **Goat**: Specialized arithmetic model
|
|
|
562 |
|
563 |
### ๐๏ธ **Multimodal Models**
|
564 |
+
- **LLaVA**: Large Language and Vision Assistant
|
565 |
+
- **MiniGPT-4**: Multimodal conversational AI
|
566 |
+
|
567 |
+
## ๐พ Download Size Reference
|
568 |
+
|
569 |
+
| Model Size | FP16 | 8-bit | 4-bit | Use Case |
|
570 |
+
|------------|------|-------|-------|----------|
|
571 |
+
| **1-3B** | 2-6GB | 1-3GB | 0.5-1.5GB | Mobile, Edge |
|
572 |
+
| **7B** | 13GB | 7GB | 3.5GB | Desktop, Laptop |
|
573 |
+
| **13B** | 26GB | 13GB | 7GB | Workstation |
|
574 |
+
| **30-34B** | 60GB | 30GB | 15GB | Server, Cloud |
|
575 |
+
| **70B** | 140GB | 70GB | 35GB | High-end Server |
|
576 |
+
|
577 |
+
## ๐ ๏ธ Where to Download
|
578 |
+
|
579 |
+
### **Primary Sources**
|
580 |
+
- **๐ค Hugging Face**: Largest repository with 400,000+ models
|
581 |
+
- **๐ฆ Ollama**: Simple CLI tool for local deployment
|
582 |
+
- **๐ฆ LM Studio**: User-friendly GUI for model management
|
583 |
+
|
584 |
+
### **Quantized Formats**
|
585 |
+
- **GGUF**: Best for CPU inference (llama.cpp)
|
586 |
+
- **GPTQ**: GPU-optimized quantization
|
587 |
+
- **AWQ**: Advanced weight quantization
|
588 |
+
|
589 |
+
### **Download Tips**
|
590 |
+
- Use `git lfs` for large models from Hugging Face
|
591 |
+
- Consider bandwidth and storage before downloading
|
592 |
+
- Start with 4-bit quantized versions for testing
|
593 |
+
- Use `ollama pull model_name` for easiest setup
|
594 |
+
|
595 |
+
## ๐ง Optimization Strategies
|
596 |
+
|
597 |
+
### **Memory Reduction**
|
598 |
+
- **4-bit quantization**: 75% memory reduction
|
599 |
+
- **8-bit quantization**: 50% memory reduction
|
600 |
+
- **CPU offloading**: Use system RAM for overflow
|
601 |
+
|
602 |
+
### **Speed Optimization**
|
603 |
+
- **GPU acceleration**: CUDA, ROCm, Metal
|
604 |
+
- **Batch processing**: Process multiple requests
|
605 |
+
- **Context caching**: Reuse computations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
""")
|
607 |
|
608 |
+
# Footer with updated resources
|
609 |
st.markdown("---")
|
610 |
st.markdown("""
|
611 |
+
### ๐ Essential Download & Deployment Tools
|
612 |
+
|
613 |
+
**๐ฆ Easy Model Deployment:**
|
614 |
+
- [**Ollama**](https://ollama.ai/) โ `curl -fsSL https://ollama.ai/install.sh | sh`
|
615 |
+
- [**LM Studio**](https://lmstudio.ai/) โ Drag-and-drop GUI for running models locally
|
616 |
+
- [**GPT4All**](https://gpt4all.io/) โ Cross-platform desktop app for local LLMs
|
617 |
+
|
618 |
+
**๐ค Model Repositories:**
|
619 |
+
- [**Hugging Face Hub**](https://huggingface.co/models) โ Filter by model size, task, and license
|
620 |
+
- [**TheBloke's Quantizations**](https://huggingface.co/TheBloke) โ Pre-quantized models in GGUF/GPTQ format
|
621 |
+
- [**Awesome LLM**](https://github.com/Hannibal046/Awesome-LLMs) โ Curated list of models and resources
|
622 |
+
|
623 |
+
**โก Performance Tools:**
|
624 |
+
- [**llama.cpp**](https://github.com/ggerganov/llama.cpp) โ High-performance CPU inference
|
625 |
+
- [**vLLM**](https://github.com/vllm-project/vllm) โ Fast GPU
|
|
|
|
|
|
|
|
|
|