How to Clone the AI-For-Beginners Curriculum Without Translation Folders to Reduce Size

You can reduce the AI-For-Beginners repository clone size from several gigabytes to a few hundred megabytes by using Git sparse-checkout to exclude the translations and translated_images directories while keeping the core curriculum intact.

The microsoft/AI-For-Beginners repository ships with comprehensive AI coursework including Jupyter notebooks, example scripts, and a Vue-based quiz application, but it also contains over 50 language translations that dramatically increase the repository size. If you only need the English core curriculum to run the lessons locally, you can clone the AI-For-Beginners curriculum without translation folders using Git's sparse-checkout feature. This approach downloads only the lessons/, examples/, and etc/ directories while skipping the multi-gigabyte translation assets.

Understanding the Repository Structure

The repository organizes content into four main sections. The sparse-checkout method preserves the first three while omitting the last:

  • lessons/ – Core curriculum containing Jupyter notebooks, datasets, and lab instructions
  • examples/ – Self-contained notebooks illustrating basic AI concepts
  • etc/quiz-app/ – Vue 2.x quiz application and supporting frontend assets
  • translations/ – Multi-language UI strings and translated notebooks (excluded)

By filtering out the translations/ and translated_images/ directories, you retain full functionality of the Python notebooks and quiz app while minimizing disk usage.

Prerequisites

You need Git 2.25.0 or newer to use the sparse-checkout and partial-clone features. Verify your version with:

git --version

Step-by-Step Setup

Initialize a Sparse Clone

Start by creating a partial clone that downloads only repository metadata initially:

git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners

The --filter=blob:none flag prevents Git from downloading file blobs for paths you haven't requested, which is crucial because translation folders contain large binary assets like images.

Configure Sparse-Checkout Patterns

Tell Git which directories to include and exclude using cone-mode patterns.

Linux and macOS:

git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'

Windows Command Prompt:

git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"

These commands instruct Git to fetch everything under the repository root (/*) except the translations and translated_images directories.

Verify the Checkout

Confirm the exclusion worked by listing the directory contents:

ls -R

You should see lessons/, examples/, and etc/ directories present, but no translations/ folder. The .git directory remains lightweight because it only stores tree metadata for excluded paths rather than full file contents.

Install the Python Environment

The curriculum requires specific package versions defined in environment.yml. Create and activate the Conda environment:

conda env create --name ai4beg --file environment.yml
conda activate ai4beg

This installs TensorFlow, PyTorch, Keras, OpenCV, NumPy, pandas, Matplotlib, and Jupyter using the exact versions specified by the course maintainers.

Launch Notebooks and Quiz App

Open any lesson directly without translation overhead:

jupyter lab lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb

To run the interactive quiz application locally:

cd etc/quiz-app
npm install
npm run serve

The quiz app launches at http://localhost:8080 and functions independently of translation files because all UI strings are bundled in the source code.

Complete Setup Commands

Copy and run these blocks based on your operating system:

Linux/macOS full setup:


# Clone without translations

git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners
git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'

# Install environment

conda env create --name ai4beg --file environment.yml
conda activate ai4beg

# Launch sample lesson

jupyter lab lessons/4-ComputerVision/07-ConvNets/ConvNetsPyTorch.ipynb

Windows full setup:

git clone --filter=blob:none --sparse https://github.com/microsoft/AI-For-Beginners.git
cd AI-For-Beginners
git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"
conda env create --name ai4beg --file environment.yml
conda activate ai4beg

Key Configuration Files

These files in the sparse checkout control your development environment:

Summary

  • Sparse-checkout reduces the AI-For-Beginners clone size by excluding translations/ and translated_images/ directories while preserving core functionality.
  • Use git clone --filter=blob:none --sparse combined with git sparse-checkout set --no-cone to filter directories at clone time.
  • The core curriculum in lessons/ and examples/ works independently of translation files.
  • The quiz app in etc/quiz-app/ contains bundled UI strings and operates normally without translation folders.
  • Windows users must use double quotes in sparse-checkout patterns, while Linux/macOS users use single quotes.

Frequently Asked Questions

How much disk space does sparse-checkout save for AI-For-Beginners?

Excluding the translation folders typically reduces the repository size from several gigabytes to a few hundred megabytes. The exact savings depend on which translation assets exist in the current version, but the reduction is substantial because the translated_images directory contains localized screenshots and diagrams for 50+ languages.

Can I add the translation folders later if I need them?

Yes. Run git sparse-checkout set --no-cone '/*' to include all directories, then git checkout to populate the previously excluded folders. Alternatively, use git sparse-checkout add translations/ to include specific directories while maintaining other exclusions.

Does the quiz app work without translation files?

Yes. The Vue 2.x quiz application in etc/quiz-app/ bundles all UI strings directly in its source code and does not rely on the external translations/ directory. You can run npm run serve immediately after cloning without translations, and the app will serve the English interface at localhost:8080.

Why use --filter=blob:none instead of a shallow clone?

--filter=blob:none performs a partial clone that downloads blobs only for files you actually checkout, whereas --depth=1 creates a shallow clone that still downloads all directories at HEAD. Since the goal is to exclude specific directories (not just history), sparse-checkout with blob filtering preserves the full Git history for the files you keep while skipping large binary assets in excluded paths.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →