InternLM

Stale
GitHub Python Apache-2.0

Description

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.

Key Features

  • 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
  • Multi-backend inference — Compatible with Transformers, vLLM, Ollama, LMDeploy, SGLang
  • Strong benchmarks — SOTA performance on CMMLU, MATH, GPQA, and other benchmarks
  • Open and commercial-friendly — Apache-2.0 license, fully open model weights and code

Use Cases

💡 Intelligent chat assistant: Build multi-turn dialogue systems with deep reasoning in Chinese and English
💡 Long-document analysis: Process ultra-long context documents for summarization, Q&A, and extraction
💡 Math and coding tasks: Use deep thinking mode for complex math proofs and code generation
💡 Domain fine-tuning: Efficiently fine-tune InternLM on domain-specific data

Quick Start

# Install Transformers
pip install torch transformers

# Load InternLM3-8B-Instruct
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("internlm/internlm3-8b-instruct", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("internlm/internlm3-8b-instruct", trust_remote_code=True, torch_dtype=torch.float16)
model.eval()

# Inference
response, history = model.chat(tokenizer, "Hello, please introduce yourself", history=[])
print(response)

Related Projects