Llama 2

Stale
GitHub Python NOASSERTION

Description

Meta's open-source Llama 2 foundational LLM with pretrained and fine-tuned models from 7B to 70B parameters, supporting chat and text completion as a cornerstone of the open LLM ecosystem.

Key Features

  • Multiple parameter sizes — 7B, 13B, 34B, and 70B parameter variants
  • Base and chat models — Both pretrained base and instruction-fine-tuned Chat versions available
  • Commercial-friendly license — Free for both research and commercial use
  • HuggingFace compatible — Full support for Transformers library loading and inference
  • llama.cpp deployment — Efficiently run on consumer hardware via llama.cpp
  • Code Llama — Specialized fine-tune for code generation

Use Cases

💡 Open-source LLM foundation: Use as base weights for downstream fine-tuning and research
💡 On-premise deployment: Privately deploy Llama 2 on local GPUs for inference
💡 Instruction tuning research: Conduct RLHF, SFT, and other instruction tuning research on base models
💡 Code generation: Use Code Llama for code understanding and generation tasks

Strengths & Limitations

Strengths

  • High community interest (59.6k stars)
  • Established track record (3 years in production)
  • Responsive to issues, low backlog

⚠️ Limitations

  • No updates in over 19 months
  • No clear open-source license

Quick Start

# Install dependencies
pip install torch transformers

# Load from HuggingFace
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat-hf", torch_dtype=torch.float16, device_map="auto")

# Inference
inputs = tokenizer("Hello, how are you?", return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(output[0], skip_special_tokens=True))

# Or use llama.cpp
# git clone https://github.com/ggerganov/llama.cpp && make
# ./main -m models/llama-2-7b-chat.gguf -p "Hello"

Related Projects

InternLM

7.3k · Python
Stale B

Open-source LLM family by Shanghai AI Lab, spanning 1.8B to 20B parameter models with long-context reasoning, deep thinking mode, and efficient fine-tuning for chat, reasoning, and code generation.

llmpretrained-modelinference +3
  • · Multiple parameter sizes — 1.8B, 7B, 20B variants to match different hardware budgets
  • · Deep thinking mode — Long chain-of-thought reasoning for complex math and logic tasks
  • · Long context window — Up to 1M token input, ideal for long-document processing

Megatron-LM

17.7k · Python
Active A

NVIDIA's open-source GPU-optimized library for training transformer models at scale, providing tensor parallelism, pipeline parallelism, sequence parallelism, and mixed-precision (FP8/FP4) support — the core foundation for trillion-parameter LLM training.

transformerdistributed-traininggpu +3
  • · Tensor parallelism (TP) — Shard individual transformer layers across GPUs to reduce per-card memory
  • · Pipeline parallelism (PP) — Distribute model layers across GPUs for ultra-large models
  • · Context parallelism (CP) — Handle ultra-long sequences efficiently with million-token training

Agently

1.6k · Python
Active A

A GenAI application development framework that simplifies agent interaction with structured data and chained-calls syntax, using event-driven flow for complex logic.

agentpythonframework +1
  • · Structured output control with framework-guaranteed schemas, required field extraction, and retry validation
  • · Runtime Skills system for discovering, installing, and executing MCP/script capabilities on demand
  • · TriggerFlow event-driven workflows with fan-out, pause/resume, save/load, and sub-flow support

Atomic Agents

6.2k · Python
Active A+

Atomic Agents is a modular AI agent building framework with an atomic design philosophy, providing composable components including tools, pipelines, and memory management for constructing agent systems.

frameworkpythonagent +2
  • · Atomic design philosophy with single-purpose, reusable, composable components
  • · Built on Instructor and Pydantic for type-safe, predictable agent behavior
  • · Multi-provider support including OpenAI, Anthropic, Groq, Gemini, and more

Related Articles