Skip to main content

KataGo Practical Getting Started Guide

This chapter takes you from installation to practical KataGo usage, covering all essential operational knowledge. Whether you want to integrate KataGo into your application or dive deep into its source code, this is your starting point.

Why Choose KataGo?

Among many Go AIs, KataGo is currently the best choice for these reasons:

AdvantageDescription
Strongest strengthConsistently maintains highest level in public tests
Most featuresScore prediction, territory analysis, multiple rule support
Fully open sourceMIT license, free to use and modify
Active updatesActive development and community support
Well documentedDetailed official documentation, rich community resources
Multi-platformRuns on Linux, macOS, Windows

Chapter Contents

Installation and Setup

Build KataGo environment from scratch:

  • System requirements and hardware recommendations
  • Installation steps for each platform (macOS / Linux / Windows)
  • Model download and selection guide
  • Detailed configuration file explanations

Common Commands

Master how to use KataGo:

  • GTP (Go Text Protocol) introduction
  • Common GTP commands and examples
  • Analysis Engine usage
  • Complete JSON API documentation

Source Code Architecture

Deep understanding of KataGo implementation details:

  • Project directory structure overview
  • Neural network architecture analysis
  • Search engine implementation details
  • Training process overview

Quick Start

If you just want to quickly try KataGo, here's the simplest approach:

macOS (using Homebrew)

# Install
brew install katago

# Download model (choose smaller model for testing)
curl -L -o kata-b18c384.bin.gz \
https://media.katagotraining.org/uploaded/networks/models/kata1/kata1-b18c384nbt-s9996604416-d4316597426.bin.gz

# Run GTP mode
katago gtp -model kata-b18c384.bin.gz -config gtp_example.cfg

Linux (pre-built version)

# Download pre-built version
wget https://github.com/lightvector/KataGo/releases/download/v1.15.3/katago-v1.15.3-opencl-linux-x64.zip

# Extract
unzip katago-v1.15.3-opencl-linux-x64.zip

# Download model
wget https://media.katagotraining.org/uploaded/networks/models/kata1/kata1-b18c384nbt-s9996604416-d4316597426.bin.gz

# Run
./katago gtp -model kata-b18c384nbt-*.bin.gz -config default_gtp.cfg

Verify Installation

After successful startup, you'll see the GTP prompt. Try entering these commands:

name
= KataGo

version
= 1.15.3

boardsize 19
=

genmove black
= Q16

Use Case Guides

Based on your needs, here are suggested reading order and focus areas:

Scenario 1: Integrate into Go App

You want to use KataGo as AI engine in your Go application.

Focus reading:

  1. Installation and Setup - Understand deployment requirements
  2. Common Commands - Especially the Analysis Engine section

Key knowledge:

  • Use Analysis Engine mode rather than GTP mode
  • Communicate with KataGo via JSON API
  • Adjust search parameters based on hardware

Scenario 2: Build Game Server

You want to set up a server for users to play against AI.

Focus reading:

  1. Installation and Setup - GPU setup section
  2. Common Commands - GTP protocol section

Key knowledge:

  • Use GTP mode for playing games
  • Multi-instance deployment strategy
  • Strength adjustment methods

Scenario 3: Research AI Algorithms

You want to deeply study KataGo's implementation, possibly modify or experiment.

Focus reading:

  1. Source Code Architecture - Read thoroughly
  2. All paper analyses in background knowledge chapter

Key knowledge:

  • C++ code structure
  • Neural network architecture details
  • MCTS implementation

Scenario 4: Train Your Own Model

You want to train from scratch or fine-tune KataGo models.

Focus reading:

  1. Source Code Architecture - Training process section
  2. KataGo Paper Analysis

Key knowledge:

  • Training data format
  • Training script usage
  • Hyperparameter configuration

Hardware Recommendations

KataGo can run on various hardware, but performance varies significantly:

Hardware ConfigurationExpected PerformanceUse Case
High-end GPU (RTX 4090)~2000 playouts/secTop analysis, fast search
Mid-range GPU (RTX 3060)~500 playouts/secGeneral analysis, playing
Entry GPU (GTX 1650)~100 playouts/secBasic use
Apple Silicon (M1/M2)~200-400 playouts/secmacOS development
CPU only~10-30 playouts/secLearning, testing
tip

Even on slower hardware, KataGo can provide valuable analysis. Reduced search amounts decrease precision, but for teaching and learning it's usually sufficient.

Frequently Asked Questions

What's the difference between KataGo and Leela Zero?

AspectKataGoLeela Zero
StrengthStrongerWeaker
FeaturesRich (score, territory)Basic
Multiple rulesSupportedNot supported
Development statusActiveMaintenance mode
Training efficiencyHighLower

Do I need a GPU?

Not required, but strongly recommended:

  • With GPU: Can do fast analysis, get high quality results
  • Without GPU: Can use Eigen backend, but slower

Model file differences?

Model SizeFile SizeStrengthSpeed
b10c128~20 MBMediumFastest
b18c384~140 MBStrongFast
b40c256~250 MBVery strongMedium
b60c320~500 MBStrongestSlow

Usually recommend b18c384 or b40c256, balancing strength and speed.

Ready? Let's start with Installation and Setup!