awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
karpathy avatar

karpathy/llama2.c

0
View on GitHub↗
19,183 stars·2,445 forks·C·mit·9 views

Llama2.c

Llama2.c is a minimal inference engine designed to execute transformer-based language models using only standard C code. By implementing neural network forward passes without external dependencies or complex runtime environments, it provides a lightweight execution environment for running pre-trained models.

The project distinguishes itself through a focus on portability and resource efficiency. It utilizes static memory allocation to avoid dynamic heap management and maps model parameter files directly into the process address space to minimize memory overhead. The implementation relies on standard library functions and optimized linear algebra routines to perform matrix multiplication, ensuring the engine can operate across diverse hardware environments.

Beyond inference, the repository includes utilities for training custom tokenizers, allowing users to generate vocabulary files and define tokenization rules from raw text data. This combination of model execution and data preparation tools serves as a resource for studying the fundamental mechanics of transformer architectures and deploying neural networks in environments with limited processing power.

Features

  • Inference Engines - Implements a minimal C-based engine for running transformer-based language models through forward passes.
  • Large Language Models - Executes transformer-based language models in resource-constrained environments using standard C code.
  • Minimalist Inference Runtimes - Runs pre-trained language models through forward passes in a minimal, dependency-free environment.
  • Local Model Runners - Provides a lightweight execution environment for performing neural network inference on pre-trained language models.
  • Single-Header Libraries - Implements neural network inference using a portable, single-header C codebase without external dependencies.
  • Edge AI Deployment Pipelines - Enables neural network execution on resource-constrained hardware through a minimal and portable codebase.
  • Large Language Models - Minimalist C-based inference engine for Llama 2 architecture.
  • Memory-Mapped File Access - Maps model parameter files directly into process memory to minimize overhead and improve loading efficiency.
  • Text Tokenizers - Includes tools for training custom tokenizers and defining rules for raw text processing.
  • Static Memory Allocations - Uses static memory allocation to manage buffers and ensure predictable performance during inference.
  • Text Tokenization Utilities - Provides utilities for creating vocabulary files and tokenization rules from raw text data.
  • Dataset Tokenization Tools - Provides utilities for generating vocabulary files and defining tokenization rules from raw text data.
  • Bytecode-Free Inference Engines - Executes neural network weights directly without requiring intermediate bytecode or complex runtime interpreters.

Star history

Star history chart for karpathy/llama2.cStar history chart for karpathy/llama2.c

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Llama2.c

Similar open-source projects, ranked by how many features they share with Llama2.c.
  • sgl-project/sglangsgl-project avatar

    sgl-project/sglang

    29,079View on GitHub↗

    Sglang is a high-performance inference engine and serving system designed for large language and multimodal models. It provides a programmable interface for orchestrating complex generation workflows, enabling developers to coordinate multi-turn dialogues, tool invocations, and reasoning chains through a domain-specific language. The platform is built to support production-scale deployments, offering an OpenAI-compatible API that allows for integration with existing application ecosystems. The system distinguishes itself through a disaggregated architecture that separates compute-intensive pr

    Pythonattentionblackwellcuda
    View on GitHub↗29,079
  • xai-org/grok-1xai-org avatar

    xai-org/grok-1

    51,690View on GitHub↗

    Grok-1 is an open-weights large language model implementation featuring a sparse mixture-of-experts architecture. It is designed for high-performance text generation and natural language processing by activating only a subset of specialized expert layers per token. The model utilizes 8-bit weight quantization to reduce memory overhead and accelerate loading. To manage its high parameter count, the implementation supports activation sharding, which distributes the memory load across multiple hardware devices during execution. The project covers large-scale model inference, including text comp

    Python
    View on GitHub↗51,690
  • eleutherai/gpt-neoxEleutherAI avatar

    EleutherAI/gpt-neox

    7,392View on GitHub↗

    gpt-neox is a distributed training system and framework for building large-scale autoregressive language models. It implements the transformer architecture and provides a toolkit for training models with billions of parameters by distributing weights across compute clusters. The framework distinguishes itself through extensive support for distributed model parallelism, including pipeline and sequence parallelism, to overcome single-device memory limits. It further supports sparse model architectures using a mixture of experts system with Sinkhorn-based routing. The project covers a broad ran

    Pythondeepspeed-librarygpt-3language-model
    View on GitHub↗7,392
  • meta-llama/llama3meta-llama avatar

    meta-llama/llama3

    29,254View on GitHub↗

    Llama 3 is a collection of pretrained, autoregressive transformer-based models designed for natural language generation, reasoning, and complex instruction following. It functions as a generative AI framework that provides the infrastructure for managing model weights, executing neural network inference, and handling computational workloads across diverse knowledge domains. The project distinguishes itself through an integrated AI safety toolkit that employs secondary classification filtering to inspect inputs and outputs, ensuring adherence to usage compliance and safety standards. It suppor

    Python
    View on GitHub↗29,254
See all 30 alternatives to Llama2.c→

Frequently asked questions

What does karpathy/llama2.c do?

Llama2.c is a minimal inference engine designed to execute transformer-based language models using only standard C code. By implementing neural network forward passes without external dependencies or complex runtime environments, it provides a lightweight execution environment for running pre-trained models.

What are the main features of karpathy/llama2.c?

The main features of karpathy/llama2.c are: Inference Engines, Large Language Models, Minimalist Inference Runtimes, Local Model Runners, Single-Header Libraries, Edge AI Deployment Pipelines, Memory-Mapped File Access, Text Tokenizers.

What are some open-source alternatives to karpathy/llama2.c?

Open-source alternatives to karpathy/llama2.c include: sgl-project/sglang — Sglang is a high-performance inference engine and serving system designed for large language and multimodal models. It… xai-org/grok-1 — Grok-1 is an open-weights large language model implementation featuring a sparse mixture-of-experts architecture. It… eleutherai/gpt-neox — gpt-neox is a distributed training system and framework for building large-scale autoregressive language models. It… meta-llama/llama3 — Llama 3 is a collection of pretrained, autoregressive transformer-based models designed for natural language… qwenlm/qwen — Qwen is a comprehensive framework for large language model development, serving, and deployment. It provides a… internlm/internlm — InternLM is a large language model and a comprehensive suite of weights designed for text generation and complex…