Okay, let's break down the best open LLMs with under 11 billion active parameters. This is a sweet spot – powerful enough for many tasks, but still runnable on consumer hardware (with enough RAM/VRAM). I'll categorize them, give details, and point you to resources. "Best" is subjective, so I'll highlight strengths. I'll also include a rough idea of VRAM needed for inference (this varies a lot based on quantization, context length, and other factors).
Important Considerations Before We Start:
- Quantization: This is crucial. Quantizing a model (e.g., to 4-bit or 8-bit) drastically reduces its memory footprint with a (usually) acceptable loss in quality. I'll assume you'll be using quantization unless otherwise stated. Tools like
llama.cpp, AutoGPTQ, and bitsandbytes are essential.
- Context Length: The context length (e.g., 2048, 4096 tokens) affects VRAM usage. Longer context = more VRAM.
- Active vs. Total Parameters: Some models have a large number of total parameters, but clever architecture means fewer are actively used during inference. I'm focusing on active parameters here.
- Licensing: Double-check the license before using a model for commercial purposes. Most are permissive, but it's vital to confirm.
- Hugging Face: Most of these models are available on the Hugging Face Hub: https://huggingface.co/
Here's a breakdown, grouped by general capability/focus. I'll give approximate VRAM needs for 4-bit quantization (a common starting point).
I. Strong General-Purpose Models (Good All-Rounders)
These models aim to be good at a wide variety of tasks: text generation, question answering, coding, etc.
- Mistral 7B (7.3B parameters): Highly regarded. Often outperforms models much larger than itself. Excellent reasoning and coding abilities. Very popular.
- Zephyr 7B (7B parameters): A fine-tune of Mistral 7B, specifically trained for helpfulness and alignment (following instructions well). Excellent for chatbot-like applications.
- OpenHermes 2.5 Mistral 7B (7B parameters): Another excellent fine-tune of Mistral 7B, focused on conversational ability and role-playing. Very popular in the community.
- Solar 10.7B (10.7B parameters): A strong contender, often competitive with Mistral 7B, and sometimes surpassing it on certain benchmarks. It's a bit larger, so requires more VRAM.
II. Coding Focused Models
These are specifically trained to excel at code generation and understanding.
- CodeLlama 7B (7B parameters): From Meta. Specifically designed for coding tasks. Available in base, Python, and Instruct versions. The Instruct version is best for following coding instructions.
- WizardCoder 7B (7B parameters): Another strong coding model, often outperforming CodeLlama on certain benchmarks.
III. Specialized/Interesting Models
- TinyLlama 1.1B (1.1B parameters): Don't let the size fool you. This is a surprisingly capable model, especially considering its small footprint. Excellent for experimentation and resource-constrained environments.
- Phi-2 (2.7B parameters): From Microsoft. Demonstrates strong reasoning capabilities despite its small size. Requires a bit more careful prompting.
Tools for Running These Models:
Recommendations:
- For a great all-rounder: Start with Mistral 7B. It's a fantastic model and has a large community.
- For chatbots: Zephyr 7B or OpenHermes 2.5 Mistral 7B are excellent choices.
- For coding: CodeLlama 7B (Instruct) or WizardCoder 7B are the way to go.
- For experimentation/low resources: TinyLlama 1.1B is surprisingly capable.
To help me narrow down the best recommendation for you, could you tell me:
- What do you want to do with the model? (e.g., chatbot, code generation, writing stories, general question answering)
- What hardware do you have? (CPU, GPU, RAM, VRAM)
- Are you comfortable with the command line, or do you prefer a GUI?
I hope this comprehensive overview is helpful! Let me know if you have any other questions.