mihailik commited on
Commit
5f49118
·
1 Parent(s): 1545694

Updating the research doc.

Browse files
Files changed (1) hide show
  1. localm-models.md +175 -201
localm-models.md CHANGED
@@ -1,239 +1,213 @@
 
1
 
 
2
 
3
- # **An Expert Analysis of Public LLMs for In-Browser Inference with Transformers.js**
4
 
5
- ### **Executive Summary: The State of Browser-Based LLMs**
6
 
7
- The paradigm of executing sophisticated artificial intelligence models directly within a web browser has advanced from a theoretical concept to a practical, and increasingly viable, reality. This shift is predicated on the confluence of three pivotal technologies: the transformers.js library, the ONNX model format, and hardware-accelerated Web runtimes, most notably WebGPU. The core finding of this analysis is that the effective performance of a model in a browser environment is not determined by its raw size alone, but rather by the degree of intelligent optimization, primarily through quantization. Smaller, highly-tuned models such as the Phi-3 series, when properly optimized, are observed to consistently outperform larger, unoptimized counterparts in real-world browser applications. This sentiment is widely echoed across technical communities and corroborated by benchmark comparisons.
8
 
9
- This report concludes that the future of on-device AI is intrinsically tied to a decentralized, privacy-first architecture, which bypasses the need for costly and latency-prone API calls to external servers. For developers prioritizing user privacy, low latency, and reduced operational costs, the combination of a compact, quantized LLM (typically under 4 billion parameters) with a WebGPU-enabled runtime offers a compelling and robust solution. For more computationally intensive tasks, a hybrid model that intelligently combines client-side processing for common queries and server-side inference for complex requests represents a pragmatic and scalable approach.
10
 
11
- The trend toward browser-based AI is a fundamental change in the developer mindset. It enables a new class of applications capable of handling sensitive data entirely on the client side, offering enhanced security and user control.
12
 
13
- ---
14
 
15
- ## **Part I: The Browser as an AI Runtime**
16
 
17
- ### **1.1. Foundational Concepts for On-Device Inference**
18
 
19
- The execution of Large Language Models (LLMs) directly within a web browser is made possible by a specialized software stack designed to overcome the inherent limitations of client-side environments, such as constrained memory, limited computational power, and network latency. The transformers.js library serves as the linchpin of this ecosystem. It is a JavaScript library engineered to be a functional analogue to the popular Python transformers library, allowing developers to leverage the same pretrained models using a nearly identical API.1 This design philosophy democratizes access to state-of-the-art models for a vast community of web developers who are already proficient in JavaScript. The library's capabilities are extensive, supporting a wide array of tasks across multiple modalities, including natural language processing, vision, and multimodal applications.1
20
 
21
- At the heart of transformers.js's operational capability lies its reliance on the ONNX (Open Neural Network Exchange) format and the corresponding ONNX Runtime Web.1 ONNX functions as a crucial intermediary, a format that allows for the conversion of models trained in diverse frameworks like PyTorch or TensorFlow into a single, standardized representation. This standardized format is essential for achieving the cross-platform compatibility required to run models reliably in different web browsers. The conversion process from a native training format to ONNX is a streamlined procedure, often facilitated by Hugging Face's
22
 
23
- Optimum library.1 For a model to be considered
24
 
25
- transformers.js-ready, it must either have a pre-converted ONNX version publicly available or be structured in a way that allows for easy conversion, such as by placing its ONNX weights in a dedicated subfolder within the repository.3
26
 
27
- A critical and unavoidable step for making models viable in a web browser is optimization through quantization. LLMs are typically trained using 32-bit floating-point precision (FP32), which requires a substantial memory footprint and immense computational resources. This precision level is impractical for client-side environments where every byte of data transferred and every cycle of computation is a critical concern.5 Quantization addresses this challenge by reducing the precision of the model's weights from higher-bit formats (e.g., FP32, FP16) to lower-bit formats (e.g., INT8, INT4).6 This reduction results in a significantly smaller model size and faster inference times, as it requires less memory and bandwidth for data transfer and fewer computational cycles.6 While this process can introduce a minimal loss in model accuracy, the community has found that the trade-off is often well worth the performance gains.
28
 
29
- The degree of this trade-off is a strategic decision. Research demonstrates that the relationship between quantization level and model performance is not always linear. For certain complex tasks, such as logical reasoning, a larger model with an aggressive 2-bit quantization scheme (e.g., Q2\_K) can outperform a smaller model with a less aggressive 6-bit quantization scheme (Q6\_K) despite having a similar memory footprint.8 This highlights that a "one-size-fits-all" approach to quantization is ineffective. The optimal choice of a model and its quantization level must be carefully considered based on the application's primary function and the type of reasoning it requires. This is why the community has developed a variety of naming conventions, such as
30
 
31
- GGUF, AWQ, and Q\_K, to denote specific quantization methods, reflecting the ongoing experimentation and specialization in this field.7
32
 
33
- The most significant advancement in this area has been the integration of WebGPU. While transformers.js initially relied on WebAssembly (WASM) for CPU-based inference, which limited the practical size of models to a few hundred megabytes, WebGPU fundamentally alters this dynamic.10 By leveraging the user's local GPU, which is purpose-built for the parallel matrix multiplications at the core of neural network inference, WebGPU provides speed-ups ranging from 4x to an astonishing 75x compared to WASM.10 This enables the use of models with billions of parameters that were previously considered too large for a browser environment, thereby transforming a niche capability into a mainstream one.
34
 
35
- ### **1.2. The Path to Model Compatibility**
36
 
37
- Identifying models suitable for in-browser use on Hugging Face requires a strategic approach, as compatibility is not always explicitly labeled. However, several effective indicators can guide the search. The most direct method is to utilize the Hugging Face Hub’s filtering system and select the transformers.js library tag.2 This action filters the entire repository to display only models that have been explicitly configured for the library, providing a strong signal of compatibility.
38
 
39
- Beyond filtering, an even more reliable indicator is the presence of the Xenova organization. The Xenova user has become the de facto source of pre-converted, browser-ready models for the transformers.js community.2 This organization serves as a critical bridge, taking popular models from the broader Hugging Face ecosystem and re-packaging them with the necessary ONNX weights and detailed
40
 
41
- transformers.js usage examples.3 A developer who finds a model under the
42
 
43
- Xenova namespace can be highly confident in its browser readiness, as it saves them the labor of manual conversion and troubleshooting.3 This dedicated effort has established the
44
 
45
- Xenova user as a trusted stamp of quality and a key heuristic for efficient model discovery.
46
 
47
- Another important clue is the presence of a dedicated onnx subfolder within a model's repository.3 Even if a model is not tagged for
48
 
49
- transformers.js, this subfolder is a strong indication that it has been prepared for ONNX Runtime inference, which is the underlying technology transformers.js uses.
50
 
51
- The Hugging Face Hub's powerful filtering system can be combined with other criteria, such as specific tasks (e.g., text-generation or feature-extraction), to further refine the search.1 Furthermore, community-curated collections are invaluable resources. Collections from prominent contributors like
52
 
53
- Xenova or DavidAU are excellent starting points for finding models that are not only compatible but also have been proven to work in public demonstrations.12
54
 
55
- ---
56
-
57
- ## **Part II: A Curated List of Top Browser-Compatible LLMs**
58
 
59
- ### **2.1. Defining Gated vs. Non-Gated Models**
 
 
 
 
 
 
 
 
 
 
 
60
 
61
- For the purpose of this report, a clear distinction is made between "gated" and "non-gated" models, a categorization that is critical for understanding their usability within a commercial or open-source project. "Gated" models, such as those from organizations like Meta or Google, require users to be logged in to the Hugging Face platform and to explicitly accept a license agreement or acceptable use policy before they can download the model files.15 This is not a commercial paywall but a technical barrier designed to ensure users adhere to specific terms of use.
62
 
63
- Conversely, "non-gated" models are released under permissive licenses like Apache 2.0 or MIT. These models are available for download and use without any form of authentication or explicit agreement, making them unrestricted for both commercial and research applications.17 The community often discusses this distinction, with some members praising models like Microsoft’s Phi-3 for being "truly open source" because they are under the permissive MIT license, unlike the "almost open source" models from Meta that still require a formal request.18 For developers whose projects require maximum freedom from licensing friction and legal review, non-gated models under a clear, permissive license are the preferred choice.
 
 
 
 
 
 
 
 
 
 
 
64
 
65
- ### **2.2. The Top 10 Gated LLMs for Browser Use**
66
 
67
- The following models were selected based on their high performance on public leaderboards, significant community interest, and the availability of transformers.js-compatible versions.
68
 
69
- 1. **Model:** google/gemma-2b-it
70
- * **Vendor:** Google
71
- * **Size:** 2.0B parameters
72
- * **Summary:** This model is part of Google's lightweight Gemma family, built with the same technology as the Gemini models. It is highly regarded for delivering "best-in-class performance" for its size, often surpassing larger models on key benchmarks.16 The instruction-tuned version (
73
- \-it) is particularly popular for chatbot and conversational applications and is known for running efficiently on a developer's laptop. It requires users to review and agree to Google's usage license to access the files.21
74
- 2. **Model:** google/gemma-2b
75
- * **Vendor:** Google
76
- * **Size:** 2.0B parameters
77
- * **Summary:** This is the base version of the Gemma 2B model, designed for fine-tuning or integration into larger systems.16 It shares the same core architecture and performance characteristics as its instruction-tuned counterpart and is praised for its efficiency. The model is capable of running on consumer-grade hardware and is a strong foundation for building specialized in-browser applications.
78
- 3. **Model:** google/gemma-7b
79
- * **Vendor:** Google
80
- * **Size:** 7.0B parameters
81
- * **Summary:** The larger sibling in the Gemma family, this model offers enhanced performance for more complex tasks.16 It is widely used by the community to evaluate the capabilities of larger models in a browser environment, especially when leveraged with WebGPU acceleration. Community sentiment confirms that it maintains the Gemma family's efficiency and strong benchmark performance.
82
- 4. **Model:** meta-llama/Llama-2-7b-hf
83
- * **Vendor:** Meta
84
- * **Size:** 7.0B parameters
85
- * **Summary:** As a foundational model in the open-source community, Llama-2-7b is a highly popular choice for a wide range of tasks.22 It is known for its robust architecture, which features improvements over its predecessor, including a doubled context length and improved inference speed in its larger variants.22 Although gated, the model's widespread adoption has led to numerous
86
- transformers.js-compatible conversions.
87
- 5. **Model:** meta-llama/Llama-2-70b-hf
88
- * **Vendor:** Meta
89
- * **Size:** 70B parameters
90
- * **Summary:** While a 70B parameter model pushes the limits of a browser environment, it has been demonstrated to run in the browser with WebGPU acceleration on high-end consumer hardware with sufficient memory.10 The community considers this a significant technical achievement and a benchmark for the library's capabilities. Its large size provides a considerable boost in reasoning and general knowledge, making it suitable for applications where quality is prioritized over initial load time.
91
- 6. **Model:** mistralai/Mistral-7B-v0.1
92
- * **Vendor:** Mistral AI
93
- * **Size:** 7.3B parameters
94
- * **Summary:** Mistral-7B is highly regarded for its superior performance compared to models of similar or even larger size, such as Llama 2 13B, on various benchmarks.23 Its innovative architecture, which includes Grouped-Query Attention (GQA) and Sliding Window Attention (SWA), enables faster inference and efficient handling of long sequences.23 Community benchmarks consistently place it as a top contender for its size class.24
95
- 7. **Model:** mistralai/Mistral-7B-Instruct-v0.2
96
- * **Vendor:** Mistral AI
97
- * **Size:** 7.3B parameters
98
- * **Summary:** The instruction-tuned version of Mistral-7B is optimized for following instructions and chat-based interactions.23 It has demonstrated remarkable capabilities, outperforming competitors like Llama 2 13B Chat in specific tasks. It is a favorite within the community for building instruction-following applications in a client-side environment.
99
- 8. **Model:** Qwen/Qwen2.5-3B
100
- * **Vendor:** Qwen
101
- * **Size:** 3.0B parameters
102
- * **Summary:** A strong performer in the sub-4B parameter category, the Qwen2.5-3B model is highly competitive.25 The Qwen series is trained on a premium, high-quality dataset, which contributes to its strong performance in natural language understanding and coding tasks.23 It is a viable alternative for developers seeking a high-quality, efficient model in the smaller size bracket.
103
- 9. **Model:** Qwen/Qwen2.5-7B
104
- * **Vendor:** Qwen
105
- * **Size:** 8.0B parameters
106
- * **Summary:** This model is recognized on leaderboards as one of the best pretrained models in its size class.25 It is particularly noted for its exceptional performance in coding, where it can outperform even some larger models.24 The community finds it to be a robust model for applications that require a balance of reasoning, creativity, and technical capabilities.
107
- 10. **Model:** Qwen/Qwen2.5-72B
108
- * **Vendor:** Qwen
109
- * **Size:** 73B parameters
110
- * **Summary:** Similar to the Llama-70B, this model pushes the boundaries of in-browser inference.24 Its large size provides a significant leap in performance for complex, resource-intensive tasks. While the initial download and load time are substantial, its ability to run locally on a high-end machine with WebGPU demonstrates the immense potential of the browser as a runtime for even the largest models.
111
-
112
- ### **2.3. The Top 10 Non-Gated LLMs for Browser Use**
113
-
114
- These models are celebrated for their permissive licensing, which allows for maximum freedom in commercial and personal projects, in addition to their strong performance.
115
-
116
- 1. **Model:** Xenova/phi-3-mini-4k-instruct
117
- * **Vendor:** Microsoft (via Xenova)
118
- * **Size:** 3.8B parameters
119
- * **Summary:** Widely hailed as a "powerhouse" for its size, this model is a top choice for resource-constrained environments.19 Community members have expressed being "blown away by its performance," noting it performs "almost like a 7b model".19 It is praised for its strong logical reasoning, math skills, and near-perfect JSON output.19 Its permissive MIT license makes it a favorite for private and commercial projects.18
120
- 2. **Model:** Xenova/phi-1.5
121
- * **Vendor:** Microsoft (via Xenova)
122
- * **Size:** 1.3B parameters
123
- * **Summary:** An earlier model from the Phi series, Phi-1.5 is an efficient and capable model for its size.28 It was trained on highly curated synthetic data, which gives it strong performance in common sense reasoning and logical tasks.28 Its small size makes it ideal for fast, lightweight applications where a larger model is not required.
124
- 3. **Model:** Xenova/all-MiniLM-L6-v2
125
- * **Vendor:** Xenova
126
- * **Size:** 80MB (approximate)
127
- * **Summary:** This model is a cornerstone of the transformers.js ecosystem, primarily used for sentence similarity and feature extraction.3 It is celebrated for its incredibly small size and high performance, even outperforming larger models like
128
- text-embedding-ada-002 on specific tasks.29 It is a perfect choice for client-side semantic search applications where data privacy is paramount, as the embeddings can be generated locally without sending user data to a server.29
129
- 4. **Model:** Xenova/distilgpt2
130
- * **Vendor:** Hugging Face (via Xenova)
131
- * **Size:** 82M parameters
132
- * **Summary:** DistilGPT2 is a distilled version of the GPT-2 model, designed to be smaller and faster.17 Its compact size makes it an excellent choice for applications requiring very low latency, such as simple text generation or prototyping.30 It is a foundational model for demonstrating
133
- transformers.js's capabilities and is frequently used in demos.4
134
- 5. **Model:** Xenova/llama2.c-stories15M
135
- * **Vendor:** Xenova
136
- * **Size:** 15.2M parameters
137
- * **Summary:** This model is an extremely lightweight and highly-efficient model optimized for simple text generation tasks, particularly for storytelling.13 Its diminutive size makes it one of the fastest models to load and run in a browser, suitable for ultra-lightweight applications and embedded use cases.
138
- 6. **Model:** Xenova/llama2.c-stories110M
139
- * **Vendor:** Xenova
140
- * **Size:** 110M parameters
141
- * **Summary:** A larger version of the llama2.c-stories series, this model provides a better balance between size and quality for text generation.31 It remains highly efficient for browser-based inference while offering a richer generation capability than its smaller counterpart.
142
- 7. **Model:** microsoft/Phi-3-medium-128k-instruct
143
- * **Vendor:** Microsoft
144
- * **Size:** 14B parameters
145
- * **Summary:** This model is part of the Phi-3 family, known for strong reasoning and a very long context length of 128k tokens.32 Community discussion suggests that while the mini version is a powerhouse, the medium and larger models do not always scale as well in terms of performance relative to their size, possibly due to the curated but small dataset.19 However, for tasks requiring extensive context comprehension, this model is a strong candidate.
146
- 8. **Model:** FlofloB/100k\_fineweb\_continued\_pretraining\_Qwen2.5-0.5B-Instruct\_Unsloth\_merged\_16bit
147
- * **Vendor:** FlofloB
148
- * **Size:** 0.6B parameters
149
- * **Summary:** Recognized on leaderboards as a highly competitive continuously pretrained model in the sub-1B size class.25 Its small size, combined with focused training, makes it an efficient and effective model for browser use, particularly for instruction-following tasks.
150
- 9. **Model:** ehristoforu/coolqwen-3b-it
151
- * **Vendor:** ehristoforu
152
- * **Size:** 3.0B parameters
153
- * **Summary:** This model is noted as a strong performer on leaderboards for its domain-specific fine-tuning.25 It serves as an example of how a smaller, fine-tuned model can be a better choice for specific tasks than a larger, general-purpose model, making it highly valuable for targeted browser applications.
154
- 10. **Model:** fblgit/pancho-v1-qw25-3B-UNAMGS
155
- * **Vendor:** fblgit
156
- * **Size:** 3.0B parameters
157
- * **Summary:** Another model recognized on leaderboards, this one also demonstrates strong performance for its size.25 Its presence in leaderboards and community discussions makes it a credible option for developers seeking a reliable and efficient model for their browser-based projects.
158
-
159
- ---
160
-
161
- ## **Part III: Comparative Analysis and Actionable Insights**
162
-
163
- ### **3.1. Comparative Analysis: A Strategic Matrix**
164
-
165
- The selection of a model for browser-based inference is a multi-dimensional problem that requires a balanced consideration of model size, license, performance, and application-specific needs. The following table synthesizes the analysis of the 20 models identified, providing a strategic matrix for decision-making.
166
-
167
- | Model Name | License Type | Vendor | Size (Parameters) | Quantization Support | Inference Runtime | Community Opinion Summary | Best Use Cases |
168
- | :---- | :---- | :---- | :---- | :---- | :---- | :---- | :---- |
169
- | **Gated Models** | | | | | | | |
170
- | google/gemma-2b-it | Gated (Google License) | Google | 2.0B | Good | WebGPU/WASM | Best-in-class for size, efficient, strong reasoning. | Chatbots, conversational AI, local reasoning. |
171
- | google/gemma-2b | Gated (Google License) | Google | 2.0B | Good | WebGPU/WASM | High-performance base model, highly efficient. | Fine-tuning, building specialized models. |
172
- | google/gemma-7b | Gated (Google License) | Google | 7.0B | Good | WebGPU/WASM | Best-in-class for size, strong performance. | High-quality text generation, complex reasoning. |
173
- | meta-llama/Llama-2-7b-hf | Gated (Meta AUP) | Meta | 7.0B | Strong | WebGPU/WASM | Foundational model, robust architecture, solid. | General-purpose tasks, text summarization. |
174
- | meta-llama/Llama-2-70b-hf | Gated (Meta AUP) | Meta | 70B | Strong | WebGPU | Pushes boundaries, high quality on high-end hardware. | Complex logical tasks, long-context analysis. |
175
- | mistralai/Mistral-7B-v0.1 | Gated (Apache 2.0-licensed base with AUP) | Mistral AI | 7.3B | Strong | WebGPU/WASM | Superior performance, innovative architecture. | General-purpose tasks, creative writing. |
176
- | mistralai/Mistral-7B-Instruct-v0.2 | Gated (Apache 2.0-licensed base with AUP) | Mistral AI | 7.3B | Strong | WebGPU/WASM | Excellent instruction-following. | Chatbots, interactive applications. |
177
- | Qwen/Qwen2.5-3B | Gated | Qwen | 3.0B | Strong | WebGPU/WASM | High performance for its size, strong coding skills. | Coding assistance, general text generation. |
178
- | Qwen/Qwen2.5-7B | Gated | Qwen | 8.0B | Strong | WebGPU/WASM | Best-in-class for its size, excellent at coding. | Coding assistance, technical tasks. |
179
- | Qwen/Qwen2.5-72B | Gated | Qwen | 73B | Strong | WebGPU | Pushes boundaries, high quality on high-end hardware. | Complex multi-modal tasks, advanced reasoning. |
180
- | **Non-Gated Models** | | | | | | | |
181
- | Xenova/phi-3-mini-4k-instruct | Non-Gated (MIT License) | Microsoft | 3.8B | Excellent (AWQ) | WebGPU/WASM | Powerhouse for its size, performs like a 7B model. | Private chatbots, logical reasoning, JSON output. |
182
- | Xenova/phi-1.5 | Non-Gated (MIT License) | Microsoft | 1.3B | Good | WASM | Efficient, strong reasoning for its size. | Lightweight, latency-sensitive tasks. |
183
- | Xenova/all-MiniLM-L6-v2 | Non-Gated (Apache 2.0) | Xenova | 80MB | Excellent (Binary) | WASM | Incredibly small, fast, and high-quality for embeddings. | Semantic search, feature extraction. |
184
- | Xenova/distilgpt2 | Non-Gated (Apache 2.0) | Hugging Face | 82M | Good | WASM | Very fast, lightweight, excellent for demos. | Prototyping, simple text generation. |
185
- | Xenova/llama2.c-stories15M | Non-Gated | Xenova | 15.2M | Good | WASM | Extremely lightweight, ultra-fast loading. | Ultra-lightweight text generation. |
186
- | Xenova/llama2.c-stories110M | Non-Gated | Xenova | 110M | Good | WASM | Small, efficient, better quality than 15M version. | Efficient storytelling and text generation. |
187
- | microsoft/Phi-3-medium-128k-instruct | Non-Gated (MIT License) | Microsoft | 14B | Good | WebGPU | Strong long-context performance, good reasoning. | Long-document summarization, broad-context tasks. |
188
- | FlofloB/100k\_fineweb\_continued\_pretraining\_Qwen2.5-0.5B-Instruct\_Unsloth\_merged\_16bit | Non-Gated | FlofloB | 0.6B | Good | WASM | Competitive sub-1B model. | Niche, continuously trained applications. |
189
- | ehristoforu/coolqwen-3b-it | Non-Gated | ehristoforu | 3.0B | Good | WASM | Strong domain-specific fine-tuning. | Specialized chatbot, fine-tuned tasks. |
190
- | fblgit/pancho-v1-qw25-3B-UNAMGS | Non-Gated | fblgit | 3.0B | Good | WASM | Strong leaderboard performance for size. | General text generation, versatile tasks. |
191
-
192
- The comparative analysis reveals a critical dynamic: the relationship between model size, performance, and accuracy is not linear in a browser environment. While it may seem intuitive that a larger model will always perform better, the analysis suggests that the "sweet spot" for most practical browser applications is found in models that expertly balance a manageable download size with sufficient accuracy for the task at hand.29 This is exemplified by the community's high praise for models like the Phi-3 mini and Gemma 2B, which are celebrated precisely because they challenge the assumption that high-quality results necessitate a massive model size.19
193
-
194
- The community consensus on model strengths is highly nuanced. For instance, the Phi-3 series is consistently lauded for its strong logical reasoning and ability to produce near-perfect JSON output, making it an excellent choice for structured data generation tasks.19 In contrast, models from the Qwen series are noted for their exceptional coding abilities, and the Llama family is celebrated for its foundational robustness and versatility.23 This illustrates that a simple leaderboard ranking does not capture the full utility of a model; a developer's choice should be guided by the specific strengths required for their application.
195
-
196
- ### **3.2. Recommendations for Implementation**
197
-
198
- The strategic selection of a model for browser-based AI should be guided by the specific needs of the application. For lightweight, latency-sensitive applications that prioritize a seamless user experience and minimal initial load time, a small, highly-quantized, non-gated model is the optimal choice. Models like Xenova/phi-3-mini or Xenova/distilgpt2 are ideal for use cases such as a local, privacy-preserving chatbot, a client-side summarizer, or a semantic search tool.4 These models can be loaded quickly and run efficiently without a server, offering a robust and autonomous solution.
199
-
200
- For applications that demand a higher degree of quality and can accommodate a larger initial download, leveraging the power of WebGPU is essential.10 In these scenarios, a larger, gated model from the Llama, Gemma, or Mistral families may be appropriate, particularly if its specific capabilities (e.g., strong coding or reasoning) are critical to the application's function. The initial download will be substantial, but the performance gains from WebGPU will make inference fast and responsive after the model is cached.
201
-
202
- A hybrid architecture represents a balanced and strategic approach for more complex applications. In this model, a small, fast model can be used on the client side to handle common or simple user requests, while a more powerful server-side model is reserved for complex or infrequent queries.10 This approach effectively reduces API costs, improves the overall user experience by handling routine tasks instantly, and reserves server resources for where they are most needed.
203
-
204
- The browser-based AI ecosystem is still in its nascent stages, but it is developing at an accelerated pace. The continued refinement of WebGPU and the emergence of new quantization methods are constantly pushing the boundaries of what is possible. As the community continues to refine these technologies, the performance gap between client-side and server-side models will continue to narrow, ushering in a future where powerful, private AI becomes a standard and expected feature of modern web applications.
205
 
206
  #### **Works cited**
207
 
208
  1. Transformers.js \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/transformers.js/index](https://huggingface.co/docs/transformers.js/index)
209
- 2. xenova/transformers \- NPM, accessed on August 17, 2025, [https://www.npmjs.com/package/@xenova/transformers](https://www.npmjs.com/package/@xenova/transformers)
210
- 3. Xenova/all-MiniLM-L6-v2 · Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/all-MiniLM-L6-v2](https://huggingface.co/Xenova/all-MiniLM-L6-v2)
211
- 4. Xenova/distilgpt2 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/distilgpt2](https://huggingface.co/Xenova/distilgpt2)
212
- 5. An Overview of Transformers.js / Daniel Russ \- Observable, accessed on August 17, 2025, [https://observablehq.com/@ca0474a5f8162efb/an-overview-of-transformers-js](https://observablehq.com/@ca0474a5f8162efb/an-overview-of-transformers-js)
213
- 6. LLM Quantization Explained \- joydeep bhattacharjee \- Medium, accessed on August 17, 2025, [https://joydeep31415.medium.com/llm-quantization-explained-4c7ebc7ed4ab](https://joydeep31415.medium.com/llm-quantization-explained-4c7ebc7ed4ab)
214
- 7. What is LLM Quantization ? \- YouTube, accessed on August 17, 2025, [https://www.youtube.com/watch?v=vFLNdOUvD90](https://www.youtube.com/watch?v=vFLNdOUvD90)
215
- 8. LLM Quantization Comparison \- dat1.co, accessed on August 17, 2025, [https://dat1.co/blog/llm-quantization-comparison](https://dat1.co/blog/llm-quantization-comparison)
216
- 9. Can Someone Explain the Differences Between Various LLM Quantization Types? \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LLMDevs/comments/1fbdcj8/can\_someone\_explain\_the\_differences\_between/](https://www.reddit.com/r/LLMDevs/comments/1fbdcj8/can_someone_explain_the_differences_between/)
217
- 10. Excited about WebGPU \+ transformers.js (v3): utilize your full (GPU) hardware in the browser : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1fexeoc/excited\_about\_webgpu\_transformersjs\_v3\_utilize/](https://www.reddit.com/r/LocalLLaMA/comments/1fexeoc/excited_about_webgpu_transformersjs_v3_utilize/)
218
- 11. Models \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/models](https://huggingface.co/models)
219
- 12. Transformers.js demos \- a Xenova Collection \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/collections/Xenova/transformersjs-demos-64f9c4f49c099d93dbc611df](https://huggingface.co/collections/Xenova/transformersjs-demos-64f9c4f49c099d93dbc611df)
220
- 13. Xenova/llama2.c-stories15M \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/llama2.c-stories15M](https://huggingface.co/Xenova/llama2.c-stories15M)
221
- 14. 2000+ Run LLMs here \- Directly in your browser \- a DavidAU ..., accessed on August 17, 2025, [https://huggingface.co/collections/DavidAU/2000-run-llms-here-directly-in-your-browser-672964a3cdd83d2779124f83](https://huggingface.co/collections/DavidAU/2000-run-llms-here-directly-in-your-browser-672964a3cdd83d2779124f83)
222
- 15. Meta Llama \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/meta-llama](https://huggingface.co/meta-llama)
223
- 16. google/gemma-2b \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/google/gemma-2b](https://huggingface.co/google/gemma-2b)
224
- 17. distilbert/distilgpt2 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/distilbert/distilgpt2](https://huggingface.co/distilbert/distilgpt2)
225
- 18. microsoft/Phi-3-mini-4k-instruct · Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct)
226
- 19. How good is Phi-3-mini for everyone? : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1cbt78y/how\_good\_is\_phi3mini\_for\_everyone/](https://www.reddit.com/r/LocalLLaMA/comments/1cbt78y/how_good_is_phi3mini_for_everyone/)
227
- 20. Gemma vs. Llama 2 Comparison \- SourceForge, accessed on August 17, 2025, [https://sourceforge.net/software/compare/Gemma-LLM-vs-Llama-2/](https://sourceforge.net/software/compare/Gemma-LLM-vs-Llama-2/)
228
- 21. google/gemma-2b-sfp-cpp \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/google/gemma-2b-sfp-cpp](https://huggingface.co/google/gemma-2b-sfp-cpp)
229
- 22. Llama 2 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/transformers/model\_doc/llama2](https://huggingface.co/docs/transformers/model_doc/llama2)
230
- 23. Compare Mistral 7B vs. Qwen-7B in 2025 \- Slashdot, accessed on August 17, 2025, [https://slashdot.org/software/comparison/Mistral-7B-vs-Qwen-7B/](https://slashdot.org/software/comparison/Mistral-7B-vs-Qwen-7B/)
231
- 24. Mistral Small/Medium vs Qwen 3 14/32B : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1knnyco/mistral\_smallmedium\_vs\_qwen\_3\_1432b/](https://www.reddit.com/r/LocalLLaMA/comments/1knnyco/mistral_smallmedium_vs_qwen_3_1432b/)
232
- 25. Open LLM Leaderboard best models ❤️‍ \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/collections/open-llm-leaderboard/open-llm-leaderboard-best-models-652d6c7965a4619fb5c27a03](https://huggingface.co/collections/open-llm-leaderboard/open-llm-leaderboard-best-models-652d6c7965a4619fb5c27a03)
233
- 26. Phi-3: Microsoft's Mini Language Model is Capable of Running on Your Phone \- Encord, accessed on August 17, 2025, [https://encord.com/blog/microsoft-phi-3-small-language-model/](https://encord.com/blog/microsoft-phi-3-small-language-model/)
234
- 27. microsoft/Phi-3-mini-4k-instruct-gguf \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf)
235
- 28. microsoft/phi-1\_5 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/phi-1\_5](https://huggingface.co/microsoft/phi-1_5)
236
- 29. Transformers.js Run Transformers directly in the browser | Hacker News, accessed on August 17, 2025, [https://news.ycombinator.com/item?id=40001193](https://news.ycombinator.com/item?id=40001193)
237
- 30. LLMs and JavaScript: practical approaches \- Volcanic Minds, accessed on August 17, 2025, [https://volcanicminds.com/en/insights/llm-javascript-practical-guide](https://volcanicminds.com/en/insights/llm-javascript-practical-guide)
238
- 31. Xenova/llama2.c-stories110M \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/llama2.c-stories110M](https://huggingface.co/Xenova/llama2.c-stories110M)
239
- 32. microsoft/Phi-3-medium-128k-instruct \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/Phi-3-medium-128k-instruct](https://huggingface.co/microsoft/Phi-3-medium-128k-instruct)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # An Analysis of Public LLMs for In-Browser Use with transformers.js
2
 
3
+ ## I. Executive Summary: The Landscape of In-Browser LLMs on Hugging Face
4
 
5
+ ### 1.1. The New Frontier of Client-Side AI
6
 
7
+ The deployment of large language models (LLMs) directly within web browsers marks a significant and transformative shift in the field of artificial intelligence. This paradigm, known as client-side AI, is driven by a desire to overcome the limitations of traditional, server-based inference. The primary advantages include enhanced data privacy, as sensitive user data never needs to leave the client device; substantial reductions in latency, eliminating the network round-trip time required for server-side processing; and a notable decrease in server-side infrastructure costs. By offloading computation to the user's device, applications can scale more efficiently and affordably. At the heart of this movement is the transformers.js library, which serves as a pivotal bridge, enabling developers to run state-of-the-art models in a browser environment.1 The library achieves this by leveraging core web technologies such as WebGPU for hardware acceleration and ONNX Runtime for model execution. This report will provide a detailed and systematic analysis of the LLM ecosystem on Hugging Face, exploring which models are not only technically compatible with this client-side stack but also adhere to a "non-gated" access policy, which is critical for building truly seamless public-facing applications.
8
 
9
+ ### **1.2. Key Findings Snapshot**
10
 
11
+ This analysis reveals a diverse landscape of models suitable for in-browser deployment, categorized by their access policies on the Hugging Face Hub. While technically proficient models from major vendors like Meta's Llama and Google's Gemma are compatible, their "gated" access—requiring a user login and explicit agreement to a license—creates a significant hurdle for developers seeking frictionless integration.4 In contrast, models from Microsoft’s Phi series and models maintained by community members like the Xenova organization offer a genuinely non-gated experience, allowing direct, unauthenticated access to files. This distinction is crucial, as a model's open-source license does not always guarantee open access to its files. Furthermore, the report finds that model performance is not solely a function of parameter count. Architectural innovations, such as Grouped-Query Attention (GQA) and Sliding Window Attention (SWA), enable smaller models like Mistral 7B to achieve performance levels that rival and even surpass larger models from previous generations.7 The report also highlights a notable disconnect between the performance metrics cited in official model cards and the practical, subjective feedback from the developer community, emphasizing the need for a multi-faceted evaluation approach.
12
 
13
+ ## **II. Technical Foundations: The transformers.js and Hugging Face Hub Interaction Model**
14
 
15
+ ### **2.1. The transformers.js and ONNX Runtime Stack**
16
 
17
+ The capability to run sophisticated machine learning models directly in the browser is a testament to the advancements in web technology and the open-source community. The core of this functionality is the transformers.js library, which serves as a JavaScript-based analogue to its popular Python counterpart.1 This library allows developers to use a familiar API to load and run pretrained models, abstracting away the underlying complexities of in-browser machine learning.
18
 
19
+ The engine that powers this client-side inference is ONNX Runtime. The Open Neural Network Exchange (ONNX) is an open standard that defines a common set of operators and a file format for representing deep learning models.11 To be compatible with
20
 
21
+ transformers.js, models originally trained in frameworks like PyTorch or TensorFlow must first be converted into the ONNX format. This conversion process is typically performed using the Hugging Face Optimum library, which is designed to optimize models for faster inference, including quantization.11 The
22
 
23
+ transformers.js library then loads these ONNX-formatted model files into the browser.
24
 
25
+ A critical component of this ecosystem is the presence of dedicated community contributors, such as the Xenova organization.10 This group specializes in converting popular models to the ONNX format and hosting them on Hugging Face, effectively making them "web-ready" for
26
 
27
+ transformers.js users.13 This community effort addresses the logistical challenge of model conversion, a task that might otherwise deter developers from adopting client-side AI. The availability of a rich library of pre-converted models allows developers to rapidly prototype and deploy applications without needing to manage a server-side backend for inference.
28
 
29
+ ### **2.2. A Taxonomy of Model Access on Hugging Face: Gated vs. Non-Gated**
30
 
31
+ The ability to use a model for in-browser inference depends not only on its technical format but also on its access policy on the Hugging Face Hub. A critical distinction exists between "non-gated" and "gated" models, a nuance that significantly impacts the developer workflow and end-user experience.
32
 
33
+ A **"non-gated"** model, as defined in this context, is one whose files can be downloaded directly from its Hugging Face repository without any form of user authentication or prior approval.6 This access model is ideal for public-facing web applications, as it completely removes a point of friction for end-users, who can begin using the application instantly without needing a Hugging Face account. Examples of models available this way often come from community projects like Xenova or are specific, developer-friendly releases from major vendors, such as the
34
 
35
+ microsoft/phi-1\_5 model.
36
 
37
+ In contrast, a **"gated"** model requires a user to be logged in to a Hugging Face account and explicitly agree to a license or set of terms before they can access the model files.4 This "gate" is a control mechanism used by model authors to track usage and ensure compliance with an acceptable use policy.6 Notably, a model's license and its access policy are independent. For example, a model can be released under a permissive open-source license like Apache 2.0 or MIT, yet still be "gated" by a mandatory click-through agreement on the Hub. This means a developer cannot simply use an open-source license as an indicator of direct access. For developers, a gated model necessitates an extra step in their workflow, such as instructing users to log in or using a programmatic access token for server-side deployments, which can be passed as a bearer token in API calls.8
38
 
39
+ The critical implication of this access distinction is that a developer building a public web application must choose a truly non-gated model to avoid imposing a mandatory login step on their end-users. The choice of a gated model, regardless of its permissive license, introduces a significant user-experience hurdle and may not be suitable for many consumer-facing applications. The existence of a gate fundamentally changes the deployment strategy, shifting the model from a public resource to a semi-restricted one.
40
 
41
+ ### **2.3. Performance Optimization Techniques**
42
 
43
+ The feasibility and efficiency of running large language models in a web browser are heavily influenced by a range of technical optimization techniques. These methods are crucial for overcoming the inherent limitations of client-side hardware, such as constrained memory and computational resources.
44
 
45
+ One of the most impactful techniques is **quantization**, a process that reduces the numerical precision of a model's weights and activations.1 Models are typically trained using 32-bit floating-point numbers (
46
 
47
+ fp32), but for inference, their weights can be compressed into lower-precision formats like 16-bit floats (fp16) or 4-bit/8-bit integers (q4, q8).1 This reduction in precision directly translates to a smaller file size, lower memory consumption, and faster inference times.19 For instance, a small model like
48
 
49
+ DistilGPT2 can be made even more efficient through quantization, making it an ideal choice for applications where minimal download size is paramount.2 However, there is a trade-off: aggressive quantization (e.g.,
50
 
51
+ q4) can sometimes lead to a noticeable drop in accuracy on complex tasks like coding or logical reasoning, a factor that requires careful consideration during model selection.19
52
 
53
+ Beyond quantization, **architectural efficiency** plays a pivotal role. Some models are designed from the ground up to be more performant than their contemporaries, even with a similar or smaller number of parameters. A prime example is the Mistral 7B model, which incorporates novel architectural concepts such as **Grouped-Query Attention (GQA)** and **Sliding Window Attention (SWA)**.8 GQA accelerates inference speed by grouping similar queries, while SWA efficiently handles long input sequences by segmenting them into overlapping windows, reducing memory requirements.7 This architectural approach allows Mistral 7B to outperform the larger Llama 2 13B on various benchmarks, demonstrating that model design can be a more significant factor in practical performance than a raw parameter count.8 This principle challenges the conventional notion that "bigger is always better" and suggests that developers should consider a model's core architecture and its reported efficiency metrics when choosing a model for a resource-constrained environment.
54
 
55
+ ## **III. The Leading Non-Gated Models for Browser Inference**
56
 
57
+ This section profiles the top 10 non-gated models on Hugging Face that are well-suited for in-browser use with the transformers.js library. The selection is based on a balance of technical compatibility, community reputation, performance metrics, and model size, with a strong emphasis on models that offer immediate, friction-free access to their files.22
 
 
58
 
59
+ | Model Name | Vendor | Parameter Size | Key Strengths/Community Sentiment |
60
+ | :---- | :---- | :---- | :---- |
61
+ | **microsoft/Phi-3-mini-4k-instruct** | Microsoft | 3.8B | Praised for its exceptional performance-to-size ratio, rivaling older 7B models. Strong in reasoning, math, and logic. Designed for resource-constrained environments. |
62
+ | **mistralai/Mistral-7B-v0.1** | Mistral AI | 7.3B | Highly efficient, outperforms larger Llama 2 13B due to architectural innovations like GQA and SWA. A robust choice with an Apache 2.0 license. |
63
+ | **Qwen/Qwen2.5-7B** | Alibaba | 8B | Noted for superior performance in Chinese and other Asian language tasks, with strong multilingual and coding capabilities. Part of a performant model family. |
64
+ | **Xenova/distilgpt2** | Xenova | 82M | Extremely small and fast, making it ideal for prototyping or simple tasks where minimal download size and instant load times are a priority. |
65
+ | **microsoft/phi-1\_5** | Microsoft | 1.3B | An earlier model in the Phi series with an MIT license, valued for its common sense, language understanding, and logical reasoning as a foundational model for research. |
66
+ | **Xenova/all-MiniLM-L6-v2** | Xenova | 10M-100M | A specialized, lightweight model for tasks like feature extraction and sentence similarity, essential for building efficient in-browser RAG systems. |
67
+ | **Qwen/Qwen2.5-3B** | Alibaba | 3B | A smaller variant of the Qwen series that retains the core multilingual capabilities, making it more accessible for devices with limited resources. |
68
+ | **Xenova/phi-3-mini-4k-instruct** | Xenova | 3.8B | A community-maintained, web-optimized version of the popular Microsoft model, explicitly packaged for frictionless in-browser use. |
69
+ | **openai-community/gpt2** | OpenAI Community | 17.4M | A foundational model that is a reliable, lightweight choice for quick, simple text generation applications. |
70
+ | **google/flan-t5-large** | Google | 0.8B | A highly-ranked model for its size, offering excellent text-to-text generation performance in a compact form factor. |
71
 
72
+ ### **3.2. Detailed Profiles of Top 10 Non-Gated Models**
73
 
74
+ 1. **microsoft/Phi-3-mini-4k-instruct**: This 3.8B parameter model is a standout for in-browser use. Developed by Microsoft, it is celebrated in the community for a performance level that punches well above its weight class, often being compared favorably to much larger 7B models.25 Its architecture is intentionally designed for resource-constrained environments, making it an excellent candidate for client-side deployment.28 Community and technical reports highlight its strong capabilities in reasoning, math, and logic, positioning it as a highly versatile and accessible model for a wide range of applications.29 The model's open nature and permissive license make it an ideal starting point for developers building public-facing projects.26
75
+ 2. **mistralai/Mistral-7B-v0.1**: With 7.3B parameters, this model from Mistral AI is a leader in efficiency and performance. It is widely noted for outperforming Meta's larger Llama 2 13B model on several benchmarks, a feat attributed to its innovative use of Grouped-Query Attention (GQA) and Sliding Window Attention (SWA).8 These architectural enhancements reduce memory usage and accelerate inference, making it an incredibly potent option for applications that require a balance of high performance and computational efficiency. Released under the permissive Apache 2.0 license, Mistral 7B is a robust, non-gated model that has quickly become a favorite in the open-source community.8
76
+ 3. **Qwen/Qwen2.5-7B**: The Qwen series of models, developed by Alibaba, is highly regarded for its multilingual capabilities and strong performance, particularly in Asian languages.31 The 7B version is a prominent example, and community discussions highlight its excellent performance in coding tasks, with some users suggesting it can even outperform Mistral models in this domain.32 Its size places it firmly in the medium-sized category, offering a powerful option for developers building applications that require a high degree of linguistic and technical competence. The model's existence on the open-source leaderboard confirms its strong standing.24
77
+ 4. **Xenova/distilgpt2**: This model is a prime example of a model designed for extreme efficiency. As a distilled version of GPT-2, it boasts a very small parameter count of 82M.20 The primary benefit of this model is its tiny file size, which enables near-instantaneous download and load times in the browser. While its performance is limited to simpler text generation tasks, its speed and accessibility make it an ideal choice for prototyping, educational demonstrations, or applications where a minimal footprint is the highest priority.2 The Xenova organization, which maintains this model, is focused on ensuring it is fully compatible and optimized for the
78
+ transformers.js ecosystem.35
79
+ 5. **microsoft/phi-1\_5**: An earlier entry from the Phi series, this 1.3B parameter model is an important resource for researchers and developers. It is noted for its strong foundational capabilities in common sense, language understanding, and logical reasoning.36 The model's README explicitly states it was released as a "non-restricted small model to explore vital safety challenges".36 Its status as a non-gated model with an MIT license makes it a valuable, accessible tool for fine-tuning and academic projects where a solid base model is needed without the extra overhead of fine-tuning for instruction-following or reinforcement learning from human feedback.
80
+ 6. **Xenova/all-MiniLM-L6-v2**: This model is a specialized workhorse for a different kind of task. While other models focus on text generation, all-MiniLM-L6-v2 is optimized for feature extraction and sentence similarity.13 These are crucial capabilities for building in-browser Retrieval-Augmented Generation (RAG) pipelines or advanced search functions where content is processed locally to produce a vector representation. Its small size and focus on a specific task make it highly efficient and performant for its intended use case, highlighting the broader potential of the
81
+ transformers.js library beyond creative text generation.38
82
+ 7. **Qwen/Qwen2.5-3B**: This model is a smaller-scale member of the Qwen family, with a parameter size of 3B.24 It inherits the key strengths of its larger counterparts, including strong multilingual support and multi-task learning capabilities.31 The reduced size makes it a highly accessible option for a wider range of hardware, including mobile devices and older desktops, where larger models might struggle with memory constraints. It represents a compelling option for developers seeking a powerful yet compact model for general-purpose tasks.
83
+ 8. **Xenova/phi-3-mini-4k-instruct**: This is a direct web-optimized version of the popular Microsoft model, specifically repackaged by the Xenova community for seamless integration with transformers.js.39 The existence of such a model demonstrates a collaborative and dynamic ecosystem where community members take popular, performant models and adapt them for specific use cases. This model is at the forefront of client-side AI, as it is featured in demos that leverage WebGPU for hardware acceleration, demonstrating its suitability for high-performance, private in-browser chatbots.40
84
+ 9. **openai-community/gpt2**: As a foundational model, GPT-2 remains a relevant choice, especially for developers who need a very lightweight model for simple text generation. With only 17.4M parameters, it has a minimal footprint and is a reliable option for creating a basic, functional text generation feature without the overhead of larger, more complex models.41 Its widespread recognition and clear purpose make it an excellent choice for educational or quick-prototyping scenarios.
85
+ 10. **google/flan-t5-large**: This model, with 0.8B parameters, is a notable entry on the Open LLM Leaderboard for its high performance in a compact size.24 As a text-to-text model, it is particularly effective for tasks that can be framed as a conversion from one text sequence to another, such as summarization, translation, or question answering. Its small size combined with its top-tier benchmark scores for its category make it a very efficient and capable model for resource-limited environments.
86
 
87
+ ## **IV. The Leading Gated Models for transformers.js Compatibility**
88
 
89
+ This section outlines the top 10 models that, while requiring a user to accept a license or log in, are technically compatible with transformers.js and represent the highest levels of performance. Developers may choose these models for professional applications where a login flow is already in place and where superior performance, factual accuracy, or advanced capabilities are necessary.
90
 
91
+ | Model Name | Vendor | Parameter Size | Access Gate | Key Strengths/Community Sentiment |
92
+ | :---- | :---- | :---- | :---- | :---- |
93
+ | **meta-llama/Llama-2-7b-hf** | Meta | 7B | Login/Accept License | A foundational open-source model that improved upon its predecessor with more training data and longer context. Set a new standard for performance in its size class. |
94
+ | **google/gemma-2b** | Google | 2B | Login/Accept License | A lightweight open model. While positioned as state-of-the-art, community feedback is frequently negative, citing garbled and unusable responses. |
95
+ | **meta-llama/Llama-3-8B-Instruct** | Meta | 8B | Login/Accept License | A more recent, powerful model with strong reasoning. Community notes a "half-baked" initial release and subjective performance issues in long-context tasks compared to Phi-3-mini. |
96
+ | **google/gemma-7b** | Google | 7B | Login/Accept License | A larger variant of the Gemma series. Similar to the 2B version, it struggles with basic factual recall and receives poor community feedback despite its official positioning. |
97
+ | **meta-llama/Llama-2-13b-hf** | Meta | 13B | Login/Accept License | A larger, powerful model, but often benchmarked as being outperformed by the more architecturally efficient Mistral 7B. Shows that size is not the only metric for performance. |
98
+ | **Qwen/Qwen2.5-32B** | Alibaba | 33B | Login/Accept License | Highly performant model in the Qwen family. Praised by the community for excellent coding capabilities and multilingual support. A top-tier choice for demanding tasks. |
99
+ | **meta-llama/Llama-3-70B-Instruct** | Meta | 70B | Login/Accept License | A very large model demonstrating the high end of what is possible with in-browser inference, requiring significant hardware resources but delivering top performance. |
100
+ | **Qwen/Qwen1.5-110B** | Alibaba | 111B | Login/Accept License | One of the largest and most powerful models available, showing the scalability of the ecosystem for massive, top-of-the-leaderboard models. |
101
+ | **microsoft/Phi-3-medium-128k-instruct** | Microsoft | 14B | Login/Accept License | A strong model with an impressive 128k token context window, ideal for long-context tasks like document summarization and analysis. |
102
+ | **microsoft/Phi-3-small-8k-instruct** | Microsoft | 7B | Login/Accept License | The intermediate size model in the Phi-3 family, offering a competitive balance of size and performance in the 7B category. |
103
+
104
+ ### **4.2. Detailed Profiles of Top 10 Gated Models**
105
+
106
+ 1. **meta-llama/Llama-2-7b-hf**: Meta’s Llama 2 7B model is a foundational open-source LLM that set a new performance standard upon its release. It features a doubled context length and was trained on a larger corpus of tokens compared to its predecessor.42 This model, along with its siblings, is gated on the Hugging Face Hub, requiring users to log in and accept Meta's license to download the files.4 It is a powerful model that requires a developer to account for the access gate in their deployment strategy.
107
+ 2. **google/gemma-2b**: Google's Gemma 2B is an important model for its size and vendor pedigree, but it presents a cautionary tale about the gap between official claims and real-world performance. The model is described as a "lightweight, state-of-the-art open model".5 However, community feedback is surprisingly negative, with users reporting it as "garbage," "unusable," and prone to generating garbled or nonsensical responses.44 In a direct test, the 7B version could not even correctly list US presidents, making factual recall a significant weakness.44
108
+ 3. **meta-llama/Llama-3-8B-Instruct**: A more recent entry from Meta, this model offers enhanced capabilities and strong performance in complex tasks.45 However, its rollout was reportedly "half-baked," with community members experiencing challenges with fine-tuning, tokenizers, and GGUF conversion.46 One subjective evaluation found that the model performed poorly in a long-context "needle in a haystack" task compared to Phi-3-mini, suggesting potential weaknesses that may not appear in traditional benchmarks.45
109
+ 4. **google/gemma-7b**: As the larger variant of the Gemma family, the 7B model is designed to be more capable but faces similar issues as the 2B version. While its model card positions it as a state-of-the-art performer, community feedback indicates it produces garbled and factually incorrect responses, often failing at tasks that smaller models handle with ease.44 This model highlights the importance of real-world user reviews over benchmark scores for practical application development.
110
+ 5. **meta-llama/Llama-2-13b-hf**: This 13B model is a larger, more powerful member of the Llama 2 family. Despite its larger size, it is frequently cited in performance comparisons as being outperformed by the more architecturally efficient Mistral 7B model.8 This case demonstrates that parameter count alone is not a reliable indicator of performance. Its strength lies in its robust training and established position in the market.
111
+ 6. **Qwen/Qwen2.5-32B**: With 33B parameters, this model from Alibaba is a high-performance option for demanding tasks. It is praised for its excellent coding and multilingual capabilities, particularly in Chinese-centric contexts.32 For developers with access and sufficient hardware, this model represents a formidable tool for building applications that require a high degree of performance and accuracy.
112
+ 7. **meta-llama/Llama-3-70B-Instruct**: This is an extremely large model, pushing the boundaries of what is possible with local inference. Community reports confirm that this model can be run in the browser using WebGPU, although it requires a significant amount of system resources (e.g., loading up to 40 GB of data), making it suitable only for high-end hardware.40 This model serves as a proof of concept for the scalability of the
113
+ transformers.js ecosystem.
114
+ 8. **Qwen/Qwen1.5-110B**: Representing one of the largest models on the open LLM leaderboard, this 111B parameter model demonstrates the sheer scale of models available for use with the Hugging Face ecosystem.24 While highly resource-intensive, its top-tier performance on various benchmarks makes it a flagship model for applications that require the utmost capability and are not constrained by hardware limitations.
115
+ 9. **microsoft/Phi-3-medium-128k-instruct**: This 14B model from the Phi-3 family is notable for its exceptionally long context window of 128k tokens.47 This feature makes it highly suitable for tasks like document analysis, long-form content generation, and multi-turn conversations where maintaining context is critical. It is positioned for strong reasoning in code, math, and logic, but its larger size and gated access require a more deliberate selection process.47
116
+ 10. **microsoft/Phi-3-small-8k-instruct**: As the intermediate model in the Phi-3 family, this 7B model offers a compelling balance of size and performance.48 It is designed to be a strong competitor in the crowded 7B parameter space, providing a capable alternative to models like Mistral and Llama, particularly for developers who have a positive view of the Phi-3 series' approach to data quality and efficiency.26
117
+
118
+ ## **V. Comparative Analysis and Strategic Insights**
119
+
120
+ ### **5.1. The Performance Triad: Size, Speed, and Accuracy**
121
+
122
+ The selection of an ideal model for in-browser deployment is a delicate balancing act involving size, speed, and accuracy. The data reveals that a model's raw parameter count is an incomplete metric for predicting its performance in a browser environment. While it is true that larger models generally possess more capacity for complex tasks, architectural innovations and optimization techniques can radically alter this relationship.
123
+
124
+ For instance, the **Mistral 7B** model, with 7.3 billion parameters, is widely acknowledged for its ability to outperform the **Llama 2 13B** model, which has nearly twice the parameters.8 This superior performance is directly attributed to Mistral AI's implementation of novel features like Grouped-Query Attention (GQA) and Sliding Window Attention (SWA), which enhance inference speed and memory efficiency. This example demonstrates that model architecture and training strategies can have a more profound impact on practical performance than sheer size alone. For developers, this implies that filtering models solely by parameter count is an insufficient heuristic. A smaller, well-architected model can often be a far superior choice for a resource-constrained environment than a larger, less-optimized one.
125
+
126
+ Furthermore, the introduction of WebGPU has fundamentally changed the performance landscape for client-side inference. While older, WASM-based backends were primarily CPU-focused, WebGPU enables browsers to leverage the full power of a user's GPU, leading to drastic speed improvements. One community member reported speed-ups of 40-75 times for embedding models on high-end hardware, and even 4-20 times on older, integrated graphics.40 This hardware acceleration makes it possible to run much larger models, such as Llama-3.1-70B, directly in the browser, provided the user has a powerful machine.40 However, this capability comes with a trade-off: larger models still require significant initial download and memory allocation, which can limit their viability for a general-purpose public website.38
127
+
128
+ ### **5.2. The Divergence of Benchmarks and User Sentiment**
129
+
130
+ A significant finding from the analysis is the critical disconnect between how some models are presented in official benchmarks and their reception within the developer community. This is most apparent in the case of Google's **Gemma** models. While these models are officially described as "state-of-the-art" and high-performing on benchmarks 5, community feedback on platforms like Reddit paints a starkly different picture. Users have consistently labeled Gemma models as "garbage" and "unusable," reporting issues such as garbled responses, confident but incorrect answers, and an inability to handle basic factual recall tasks.44 For example, a user noted that the 7B model failed to list US presidents correctly, a task easily handled by other models of similar size.44
131
+
132
+ This disparity suggests that a model's performance on a curated set of academic benchmarks may not accurately reflect its real-world utility. Benchmarks can be susceptible to overfitting, where a model is fine-tuned to excel on a narrow range of test cases without improving its general-purpose capabilities. In contrast, community discussions reflect the outcome of testing these models on a wide array of uncurated, real-world prompts, providing a more reliable and honest assessment of their practical strengths and weaknesses. The implication for developers is clear: official performance metrics should not be the sole basis for model selection. Due diligence must include a thorough review of community feedback to ensure a model is reliable and fit for purpose, particularly for applications where factual accuracy and coherent output are critical.
133
+
134
+ ### **5.3. Licensing, Ethical Considerations, and a Hybrid Approach**
135
+
136
+ The choice of an in-browser LLM is also intertwined with broader considerations of licensing and application architecture. For developers, open-source licenses like MIT and Apache 2.0 offer the most flexibility, allowing for broad commercial and research use without significant restrictions. However, as the analysis shows, a permissive license does not guarantee a non-gated model, requiring a developer to verify the access policy before planning their deployment.6
137
+
138
+ A sophisticated development strategy would involve a hybrid approach, leveraging the strengths of both local and remote inference. A developer could use a small, non-gated model, such as Xenova/distilgpt2 or microsoft/Phi-3-mini-4k-instruct, for quick, low-latency tasks like basic summarization, text classification, or content suggestion directly within the user's browser.28 This handles the vast majority of simple requests instantly, providing an excellent user experience while reducing server costs. For more complex, resource-intensive tasks that require the power of a larger model, the application can fall back to a server-side API call. This server-side model could be a larger, more capable, and potentially gated model like
139
+
140
+ Qwen/Qwen2.5-32B, leveraging its superior reasoning or multilingual capabilities.31
141
+
142
+ This tiered system maximizes performance and efficiency. It avoids the large initial download time and memory footprint of a massive model on the client side, while still providing access to powerful AI capabilities when needed. It is a pragmatic solution that balances user experience, cost-effectiveness, and model performance, offering a blueprint for how to build scalable and robust AI-powered web applications in this evolving landscape.
143
+
144
+ ## **VI. Final Recommendations and Strategic Outlook**
145
+
146
+ Based on the comprehensive analysis of public LLMs on Hugging Face and their compatibility with transformers.js, a clear set of recommendations emerges for developers and researchers.
147
+
148
+ ### **6.1. Strategic Model Selection Guide**
149
+
150
+ * **For Prototyping and Simple Demos:** Choose ultra-lightweight, non-gated models. The openai-community/gpt2 (17.4M) and Xenova/distilgpt2 (82M) are ideal for this purpose due to their minimal download size and instant load times, making them perfect for proof-of-concept projects and educational tools.20
151
+ * **For General-Purpose In-Browser Chatbots:** For a balance of performance and accessibility, select a robust non-gated model. The microsoft/Phi-3-mini-4k-instruct is an exceptional choice, as its performance rivals older, larger models, and it is explicitly designed for resource-constrained environments.28 The
152
+ mistralai/Mistral-7B-v0.1 is another top-tier option, praised for its efficiency and strong performance on a variety of benchmarks.8
153
+ * **For Specialized and High-Performance Tasks:** For applications requiring exceptional coding ability or nuanced multilingual understanding, prioritize models from the Qwen series. The Qwen/Qwen2.5-7B is highly regarded for its coding performance, while its larger counterparts offer more power for complex tasks.32 For demanding reasoning tasks, models like
154
+ microsoft/Phi-3-medium-128k-instruct (14B) with its long context window is a strong candidate, though it requires gated access.47
155
+ * **For Enterprise and Professional Needs:** Consider a hybrid architecture that combines the strengths of local and server-side processing. Use a fast, non-gated client-side model for immediate, simple tasks, while routing complex requests to a more powerful, server-based model. This approach optimizes the user experience while allowing access to cutting-edge, potentially gated, models from vendors like Meta and Microsoft for critical applications.
156
+
157
+ ### **6.2. The Trajectory of Client-Side AI**
158
+
159
+ The future of client-side AI is a story of increasing capability and accessibility. The continued development of browser technologies like WebGPU will be a primary driver, dramatically accelerating inference speeds and making it possible to run models that were previously confined to powerful servers.40 This trend will empower developers to build more robust and feature-rich applications that respect user privacy by keeping data local. The existence of dedicated community organizations like Xenova that specialize in optimizing and distributing web-ready models is crucial for the health of this ecosystem.13 The growing number of models with the
160
+
161
+ transformers.js tag on the Hugging Face Hub signals a thriving and expanding field.49 As the efficiency of models improves and the performance of browser environments accelerates, the line between local and server-side AI will continue to blur, leading to a more decentralized, private, and efficient future for machine learning applications.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
  #### **Works cited**
164
 
165
  1. Transformers.js \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/transformers.js/index](https://huggingface.co/docs/transformers.js/index)
166
+ 2. Setup and Fine-Tune Qwen 3 with Ollama \- Codecademy, accessed on August 17, 2025, [https://www.codecademy.com/article/qwen-3-ollama-setup-and-fine-tuning](https://www.codecademy.com/article/qwen-3-ollama-setup-and-fine-tuning)
167
+ 3. Testing Gemma-7B by Google \- YouTube, accessed on August 17, 2025, [https://www.youtube.com/watch?v=36ugH3v6j1o](https://www.youtube.com/watch?v=36ugH3v6j1o)
168
+ 4. Meta Llama \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/meta-llama](https://huggingface.co/meta-llama)
169
+ 5. google/gemma-2b · Hugging Face, accessed on August 17, 2025, [https://huggingface.co/google/gemma-2b](https://huggingface.co/google/gemma-2b)
170
+ 6. Gated models \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/hub/models-gated](https://huggingface.co/docs/hub/models-gated)
171
+ 7. Mistral-7b and LLaMA-2–7b: A guide to Fine-Tuning LLMs in Google Colab \- Medium, accessed on August 17, 2025, [https://medium.com/@alecgg27895/mistral-7b-and-llama-2-7b-a-guide-to-fine-tuning-llms-in-google-colab-2ce78db37245](https://medium.com/@alecgg27895/mistral-7b-and-llama-2-7b-a-guide-to-fine-tuning-llms-in-google-colab-2ce78db37245)
172
+ 8. Unleashing the Power of Mistral 7B: Step by Step Efficient Fine-Tuning for Medical QA Chatbot | by Arash Nicoomanesh | Medium, accessed on August 17, 2025, [https://medium.com/@anicomanesh/unleashing-the-power-of-mistral-7b-efficient-fine-tuning-for-medical-qa-fb3afaaa36e4](https://medium.com/@anicomanesh/unleashing-the-power-of-mistral-7b-efficient-fine-tuning-for-medical-qa-fb3afaaa36e4)
173
+ 9. Mistral AI vs. Meta: Comparing Top Open-source LLMs | Towards Data Science, accessed on August 17, 2025, [https://towardsdatascience.com/mistral-ai-vs-meta-comparing-top-open-source-llms-565c1bc1516e/](https://towardsdatascience.com/mistral-ai-vs-meta-comparing-top-open-source-llms-565c1bc1516e/)
174
+ 10. xenova/transformers \- NPM, accessed on August 17, 2025, [https://www.npmjs.com/package/@xenova/transformers](https://www.npmjs.com/package/@xenova/transformers)
175
+ 11. ONNX \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/transformers/serialization](https://huggingface.co/docs/transformers/serialization)
176
+ 12. Huggingface \- ONNX Runtime, accessed on August 17, 2025, [https://onnxruntime.ai/huggingface](https://onnxruntime.ai/huggingface)
177
+ 13. Xenova/all-MiniLM-L6-v2 · Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/all-MiniLM-L6-v2](https://huggingface.co/Xenova/all-MiniLM-L6-v2)
178
+ 14. Xenova/phi-1\_5\_dev \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/phi-1\_5\_dev](https://huggingface.co/Xenova/phi-1_5_dev)
179
+ 15. Quickstart \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/huggingface\_hub/quick-start](https://huggingface.co/docs/huggingface_hub/quick-start)
180
+ 16. Authentication \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/huggingface\_hub/package\_reference/authentication](https://huggingface.co/docs/huggingface_hub/package_reference/authentication)
181
+ 17. LLM Quantization Explained \- joydeep bhattacharjee \- Medium, accessed on August 17, 2025, [https://joydeep31415.medium.com/llm-quantization-explained-4c7ebc7ed4ab](https://joydeep31415.medium.com/llm-quantization-explained-4c7ebc7ed4ab)
182
+ 18. Understanding hugging face model size: A comprehensive guide \- BytePlus, accessed on August 17, 2025, [https://www.byteplus.com/en/topic/496901](https://www.byteplus.com/en/topic/496901)
183
+ 19. LLM Quantization Comparison \- dat1.co, accessed on August 17, 2025, [https://dat1.co/blog/llm-quantization-comparison](https://dat1.co/blog/llm-quantization-comparison)
184
+ 20. Are Llama 3.2 and Phi 3.1 mini 3B any good for LongRAG or for document Q\&A? \- Medium, accessed on August 17, 2025, [https://medium.com/@billynewport/are-llama-3-2-and-phi-mini-any-good-for-longrag-or-for-document-q-a-35cedb13a995](https://medium.com/@billynewport/are-llama-3-2-and-phi-mini-any-good-for-longrag-or-for-document-q-a-35cedb13a995)
185
+ 21. Mistral 7B vs DeepSeek R1 Performance: Which LLM is the Better Choice? \- Adyog, accessed on August 17, 2025, [https://blog.adyog.com/2025/01/31/mistral-7b-vs-deepseek-r1-performance-which-llm-is-the-better-choice/](https://blog.adyog.com/2025/01/31/mistral-7b-vs-deepseek-r1-performance-which-llm-is-the-better-choice/)
186
+ 22. Models \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/models](https://huggingface.co/models)
187
+ 23. 2000+ Run LLMs here \- Directly in your browser \- a DavidAU ..., accessed on August 17, 2025, [https://huggingface.co/collections/DavidAU/2000-run-llms-here-directly-in-your-browser-672964a3cdd83d2779124f83](https://huggingface.co/collections/DavidAU/2000-run-llms-here-directly-in-your-browser-672964a3cdd83d2779124f83)
188
+ 24. Open LLM Leaderboard best models ❤️‍ \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/collections/open-llm-leaderboard/open-llm-leaderboard-best-models-652d6c7965a4619fb5c27a03](https://huggingface.co/collections/open-llm-leaderboard/open-llm-leaderboard-best-models-652d6c7965a4619fb5c27a03)
189
+ 25. How good is Phi-3-mini for everyone? : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1cbt78y/how\_good\_is\_phi3mini\_for\_everyone/](https://www.reddit.com/r/LocalLLaMA/comments/1cbt78y/how_good_is_phi3mini_for_everyone/)
190
+ 26. microsoft / phi-3-mini-4k-instruct \- NVIDIA API Documentation, accessed on August 17, 2025, [https://docs.api.nvidia.com/nim/reference/microsoft-phi-3-mini-4k](https://docs.api.nvidia.com/nim/reference/microsoft-phi-3-mini-4k)
191
+ 27. Phi 3 Mini 4k Instruct · Models \- Dataloop AI, accessed on August 17, 2025, [https://dataloop.ai/library/model/microsoft\_phi-3-mini-4k-instruct/](https://dataloop.ai/library/model/microsoft_phi-3-mini-4k-instruct/)
192
+ 28. microsoft/Phi-3-mini-4k-instruct \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct)
193
+ 29. microsoft/Phi-3-mini-4k-instruct-gguf \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf)
194
+ 30. Mistral AI \- Wikipedia, accessed on August 17, 2025, [https://en.wikipedia.org/wiki/Mistral\_AI](https://en.wikipedia.org/wiki/Mistral_AI)
195
+ 31. Qwen vs llama: A comprehensive comparison of AI language models \- BytePlus, accessed on August 17, 2025, [https://www.byteplus.com/en/topic/504095](https://www.byteplus.com/en/topic/504095)
196
+ 32. Mistral Small/Medium vs Qwen 3 14/32B : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1knnyco/mistral\_smallmedium\_vs\_qwen\_3\_1432b/](https://www.reddit.com/r/LocalLLaMA/comments/1knnyco/mistral_smallmedium_vs_qwen_3_1432b/)
197
+ 33. Fine-tuning Qwen3-32B for sentiment analysis. : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1lss6b9/finetuning\_qwen332b\_for\_sentiment\_analysis/](https://www.reddit.com/r/LocalLLaMA/comments/1lss6b9/finetuning_qwen332b_for_sentiment_analysis/)
198
+ 34. Transformers.js vs WebLLM : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1lw6jz5/transformersjs\_vs\_webllm/](https://www.reddit.com/r/LocalLLaMA/comments/1lw6jz5/transformersjs_vs_webllm/)
199
+ 35. Xenova/distilgpt2 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/Xenova/distilgpt2](https://huggingface.co/Xenova/distilgpt2)
200
+ 36. microsoft/phi-1\_5 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/phi-1\_5](https://huggingface.co/microsoft/phi-1_5)
201
+ 37. An Overview of Transformers.js / Daniel Russ \- Observable, accessed on August 17, 2025, [https://observablehq.com/@ca0474a5f8162efb/an-overview-of-transformers-js](https://observablehq.com/@ca0474a5f8162efb/an-overview-of-transformers-js)
202
+ 38. Transformers.js – Run Transformers directly in the browser | Hacker News, accessed on August 17, 2025, [https://news.ycombinator.com/item?id=40001193](https://news.ycombinator.com/item?id=40001193)
203
+ 39. Phi-3 WebGPU \- a Hugging Face Space by Xenova, accessed on August 17, 2025, [https://huggingface.co/spaces/Xenova/experimental-phi3-webgpu](https://huggingface.co/spaces/Xenova/experimental-phi3-webgpu)
204
+ 40. Excited about WebGPU \+ transformers.js (v3): utilize your full (GPU) hardware in the browser : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1fexeoc/excited\_about\_webgpu\_transformersjs\_v3\_utilize/](https://www.reddit.com/r/LocalLLaMA/comments/1fexeoc/excited_about_webgpu_transformersjs_v3_utilize/)
205
+ 41. Popular Hugging Face models : r/LocalLLM \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLM/comments/1jfrwyr/popular\_hugging\_face\_models/](https://www.reddit.com/r/LocalLLM/comments/1jfrwyr/popular_hugging_face_models/)
206
+ 42. Llama 2 \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/docs/transformers/model\_doc/llama2](https://huggingface.co/docs/transformers/model_doc/llama2)
207
+ 43. meta-llama/Llama-2-7b-hf · Hugging Face, accessed on August 17, 2025, [https://huggingface.co/meta-llama/Llama-2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf)
208
+ 44. Is Google Gemma really this bad?? : r/ollama \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/ollama/comments/1awwdca/is\_google\_gemma\_really\_this\_bad/](https://www.reddit.com/r/ollama/comments/1awwdca/is_google_gemma_really_this_bad/)
209
+ 45. Is Phi-3-mini really better than Llama 3? – Testing the Limits of Small LLMs in Real-World Scenarios \- ML EXPLAINED, accessed on August 17, 2025, [https://mlexplained.blog/2024/04/23/is-phi-3-mini-really-better-than-llama-3-testing-the-limits-of-small-llms-in-real-world-scenarios/](https://mlexplained.blog/2024/04/23/is-phi-3-mini-really-better-than-llama-3-testing-the-limits-of-small-llms-in-real-world-scenarios/)
210
+ 46. Phi-3-mini-Instruct is astonishingly better than Llama-3-8B-Instruct. Can't wait to try Phi-3-Medium. These models also work better than Llama-3 with the Guidance framework. : r/LocalLLaMA \- Reddit, accessed on August 17, 2025, [https://www.reddit.com/r/LocalLLaMA/comments/1cxrf6e/phi3miniinstruct\_is\_astonishingly\_better\_than/](https://www.reddit.com/r/LocalLLaMA/comments/1cxrf6e/phi3miniinstruct_is_astonishingly_better_than/)
211
+ 47. microsoft/Phi-3-medium-128k-instruct \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/microsoft/Phi-3-medium-128k-instruct](https://huggingface.co/microsoft/Phi-3-medium-128k-instruct)
212
+ 48. Azure AI Foundry Models Pricing, accessed on August 17, 2025, [https://azure.microsoft.com/en-us/pricing/details/phi-3/](https://azure.microsoft.com/en-us/pricing/details/phi-3/)
213
+ 49. Models \- Hugging Face, accessed on August 17, 2025, [https://huggingface.co/models?sort=trending\&search=Xenova](https://huggingface.co/models?sort=trending&search=Xenova)