If you're using a Mac with 32GB RAM and doing Ruby on Rails development, and you're looking for the best LLM (Large Language Model) to run locally or assist in coding, here's a breakdown of your best options based on performance, compatibility, and utility:
🔧 Why Run an LLM Locally?
Running an LLM locally can help with:
- Code completion
- Debugging assistance
- Writing documentation
- Generating tests
- Explaining complex code
Benefits include privacy, no API costs, and offline access.
✅ Best LLMs for Mac M1/M2 with 32GB RAM (for Ruby on Rails)
1. Llama 3 (8B or 70B variants)
- Developer: Meta
- Size: 8B (~5GB GGUF), 70B (~40GB GGUF)
- Best For: General use, code generation, natural language understanding
- Pros:
- Extremely powerful for both code and natural language
- Good support from tools like Ollama, LM Studio, and LocalAI
- 8B variant runs smoothly on Mac M-series with 32GB RAM
- Cons:
- The 70B version is memory-heavy; may require offloading or swap space
Recommendation: Use Llama 3 8B via Ollama — it's fast and efficient for RoR dev.
2. CodeLlama / CodeLlama-Python
- Developer: Meta
- Size: 7B, 13B, 34B
- Best For: Code generation and completion, especially in Ruby/Python
- Pros:
- Fine-tuned specifically for code generation
- Strong at Ruby, Python, JavaScript
- Works well with RoR syntax and patterns
- Cons:
- Slightly more niche than Llama 3, but better at code
Use Case: If most of your work is code-related, this might outperform Llama 3 slightly.
3. Mistral-Nemo / Mistral-Large
- Developer: Mistral AI
- Size: ~5-15GB depending on variant
- Best For: Fast and accurate code + general reasoning
- Pros:
- Very strong at code generation
- Better conversational ability than some open-source models
- Lightweight and fast
- Cons:
- Less community support than Llama models
Good Alternative: Especially if you want a balance between speed and power.
4. Solar-Instruct (Upstage)
- Size: ~10-20GB
- Pros:
- Strong at code and logic tasks
- Commercial-friendly license
- Cons:
- Less known in RoR circles
5. DeepSeek-Coder
- Size: 6.7B, 33B
- Pros:
- Excellent at multi-language code generation
- Optimized for developer workflows
- Cons:
- Not as widely supported yet in local tooling
🛠️ Tools to Run LLMs Locally on macOS
| Tool | Description |
|---|
| Ollama | Easiest way to run Llama 3, Mistral, etc., with simple CLI & API |
| LM Studio | GUI-based, supports GGUF models, easy to manage locally |
| GPT4All | Great for lightweight models, less powerful than Llama |
| Jan AI | Open-source local chat app with model management |
| VSCodium/VSCode + Copilot alternatives | Integrate local LLMs via extensions |
💡 Bonus: Pair with These Developer Tools
- GitHub Copilot (if budget allows) – Still one of the best RoR-specific coders
- Tabnine (local mode) – AI autocomplete that works offline
- Cursor.so – Like VSCode but built around LLM-powered editing
- LangChain + LlamaIndex – Build custom RoR assistant apps
📌 Final Recommendation
✅ Best Overall LLM for RoR on Mac M1/M2 with 32GB RAM:
- Llama 3 8B via Ollama
- Lightweight, powerful, and easy to integrate
- Supports RoR well with fine-tuning or prompt engineering
🧑💻 If You Want Pure Code Generation:
- CodeLlama 7B or 13B
- Specifically trained on code
- Handles Ruby/Rails patterns very well
Would you like step-by-step instructions on how to install and use Llama 3 or CodeLlama for Ruby on Rails development?