whatisgithub

What is torchchat?

pytorch/torchchat — explained in plain English

Analysis updated 2026-05-18

3,628PythonAudience · developerComplexity · 4/5Setup · hard

In one sentence

torchchat, from the PyTorch team, shows how to run large language models on laptops, servers, mobile devices, and in C++ apps, though it is no longer actively developed.

Mindmap

mindmap
  root((torchchat))
    What it does
      Run LLMs locally
      Command-line chat
      Model export
    Tech stack
      Python
      PyTorch
      C++
    Platforms
      Laptop or server
      iOS
      Android
    Status
      No longer active
      Reference code

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Run an open language model like Llama or Mistral locally on a laptop or server via the command line.

USE CASE 2

Export a model to an optimized format to embed in an iOS or Android app.

USE CASE 3

Study the codebase as a reference for running LLM inference outside the cloud in a C++ application.

What is it built with?

PythonPyTorchC++

How does it compare?

pytorch/torchchatgeex-arts/django-jetneuraloperator/neuraloperator
Stars3,6283,6273,627
LanguagePythonPythonPython
Setup difficultyhardeasymoderate
Complexity4/52/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Project is no longer actively maintained, requires Python 3.10 and a virtual environment.

License not stated in the explanation, check the repository for details.

So what is it?

torchchat is a project from the PyTorch team that demonstrates how to run large language models (the kind of AI that powers chat assistants) in many different environments: on a laptop or server using Python, embedded in a C or C++ application, and on mobile devices running iOS or Android. The goal is to show that these models do not have to live only in the cloud and can run directly on your own hardware. The project is no longer under active development, as noted in the repository, but the code remains available as a reference. While it was maintained, it supported a wide range of well-known open models including various sizes of Meta's Llama family, Mistral, IBM Granite, DeepSeek R1, and small toy models for testing. Some of those models were marked as mobile-friendly, meaning they were small enough to run on a phone. From the command line, you can have a back-and-forth conversation with a model, ask it to generate text from a prompt, or open a browser-based chat interface. There is also a server mode. For mobile and desktop use without Python, the project supports exporting models to optimized formats that can run faster in C++ applications or be packaged into iOS and Android apps. The project supports several ways to speed up inference, including compiling models ahead of time and using reduced numerical precision (smaller numbers that take less memory and compute). It works on Linux, Mac with Apple Silicon, Android devices, and iPhones with enough memory. Installation requires Python 3.10 and uses a virtual environment to keep dependencies isolated. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to run a Llama model locally using torchchat's command-line chat interface.
Prompt 2
Explain how torchchat exports a model to run inside an iOS app.
Prompt 3
What does torchchat's reduced numerical precision option do to speed up inference?
Prompt 4
Set up torchchat with Python 3.10 in a virtual environment on my Mac with Apple Silicon.

Frequently asked questions

What is torchchat?

torchchat, from the PyTorch team, shows how to run large language models on laptops, servers, mobile devices, and in C++ apps, though it is no longer actively developed.

What language is torchchat written in?

Mainly Python. The stack also includes Python, PyTorch, C++.

What license does torchchat use?

License not stated in the explanation, check the repository for details.

How hard is torchchat to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is torchchat for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.