The Stack Code Dataset
Large-scale open-source code dataset by BigCode with 546M records in 30+ programming languages, 6TB total, for code generation model training.
The Stack is a large-scale open-source code dataset built by the BigCode project, containing 546 million code files, totaling 6TB of data, covering 30+ programming languages. All source code comes from permissive repositories on GitHub and serves as the foundational dataset for training code generation models like StarCoder.
Large-scale, multilingual, high-quality open-source code corpus
Contains 546 million loosely licensed source code files, making it one of the largest open-source code datasets available, providing ample data foundation for code model training.
Covers 30+ mainstream programming languages, including Python, JavaScript, Java, C++, Go, Rust, TypeScript, etc., meeting the needs of multilingual code modeling.
All code has undergone license verification, containing only source code with loose licenses such as Apache, MIT, BSD, ensuring compliant use.
Utilizes advanced approximate deduplication algorithms to remove redundant and duplicate code patterns, improving dataset quality and training efficiency.
Detects and removes personally identifiable information (PII), including email addresses, IP addresses, and other sensitive information, protecting privacy and security.
Developers can use the Am I In The Stack tool to check and opt-out, fully respecting the wishes of code authors.
From code generation to vulnerability detection, empowering various AI programming applications
Train models like StarCoder to achieve code completion and automatic generation features
Build semantic code search and retrieval systems to enhance development efficiency
Train models to identify bugs and security vulnerabilities in code, improving code quality
Develop a code translation system across programming languages to achieve automatic conversion between languages
Quickly access The Stack code dataset via API
import requests
url = "https://api.acedata.cloud/datasets/the-stack"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
params = {
"language": "python",
"limit": 10
}
response = requests.get(url, headers=headers, params=params)
# Parse the response
data = response.json()
for file in data.get("files", []):
print(f"Path: {file['path']}")
print(f"Language: {file['language']}")
print(f"License: {file['license']}")
print(f"Size: {file['size']} bytes")
print("---")
Start using The Stack code dataset in just a few minutes
Register for an Ace Data Cloud platform account at platform.acedata.cloud and complete identity verification.
Create an API key in the console for authentication to access The Stack dataset interface.
Use the API key to call the dataset interface, filtering and retrieving code data by programming language, license, and other criteria.
546 million code files, 30+ programming languages, 6TB of massive data. Whether you are training code generation models, building code search engines, or researching software engineering, The Stack is the ideal data foundation.