# What Programming Language Is LingBot‑Map Written In?

> Discover the programming language behind LingBot-Map. This comprehensive guide reveals that LingBot-Map is written entirely in Python, offering insights for developers.

- Repository: [Robbyant/lingbot-map](https://github.com/Robbyant/lingbot-map)
- Tags: getting-started
- Published: 2026-07-19

---

**LingBot‑Map is written entirely in Python.**

The Robbyant/lingbot-map repository is a Python-based framework for streaming 3D reconstruction and visual localization. Every module—from the core transformer model to geometry utilities—is implemented as pure Python code targeting version 3.10 or higher. The project leverages PyTorch for deep learning operations while maintaining a Python-centric architecture throughout the codebase.

## Python as the Core Foundation

LingBot‑Map is unequivocally a **Python** codebase. The project configuration in [`pyproject.toml`](https://github.com/Robbyant/lingbot-map/blob/main/pyproject.toml) explicitly declares a Python requirement of `>= 3.10` and packages the software as a standard Python module. No compiled source files form the core logic; instead, the entire architecture rests on Python modules organized under the `lingbot_map/` namespace.

## Key Python Files and Architecture

The repository structure confirms the Python implementation across all components:

- **[`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py)** – The command-line entry point is a pure-Python script that orchestrates image loading, model construction, and streaming inference.
- **[`lingbot_map/models/gct_stream.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/models/gct_stream.py)** – Contains the `GCTStream` class implementing the transformer architecture using PyTorch APIs.
- **[`lingbot_map/models/gct_stream_window.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/models/gct_stream_window.py)** – Provides a windowed inference variant for processing very long sequences.
- **`lingbot_map/utils/`** – Houses helper modules for pose encoding, geometry operations, and image preprocessing, all written in standard Python.

## Running LingBot‑Map with Python

You interact with the framework through Python interfaces. Below are concrete examples demonstrating the Python-only workflow.

### Launch the Interactive Demo

Execute the streaming reconstruction pipeline directly from the command line:

```python

# Run from the command line

# python demo.py --model_path /path/to/lingbot-map-long.pt \

#                --image_folder example/courthouse --mask_sky

```

This script loads images, builds the model, performs inference, and launches a browser-based visualizer entirely from Python code.

### Programmatic Model Loading

For integration into custom pipelines, import the Python classes directly:

```python
import torch
from lingbot_map.models.gct_stream import GCTStream
from lingbot_map.utils.load_fn import load_and_preprocess_images

# Load checkpoint

ckpt_path = "/path/to/lingbot-map-long.pt"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
ckpt = torch.load(ckpt_path, map_location=device, weights_only=False)
state = ckpt.get("model", ckpt)

# Initialize GCTStream model

model = GCTStream(
    img_size=518,
    patch_size=14,
    enable_3d_rope=True,
    max_frame_num=1024,
    kv_cache_sliding_window=64,
    kv_cache_scale_frames=8,
    kv_cache_cross_frame_special=True,
    kv_cache_include_scale_frames=True,
    use_sdpa=False,
    camera_num_iterations=4,
)
model.load_state_dict(state, strict=False)
model.to(device).eval()

# Process images

image_paths = ["img1.jpg", "img2.jpg"]
images = load_and_preprocess_images(
    image_paths,
    mode="crop",
    image_size=518,
    patch_size=14,
)

# Execute streaming inference

predictions = model.inference_streaming(
    images.to(device),
    num_scale_frames=8,
    keyframe_interval=1,
    output_device=None,
)

```

This example mirrors the internal workflow used by [`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py), utilizing `torch.load()`, `GCTStream`, and `load_and_preprocess_images()` to run inference without leaving the Python environment.

### Optional Acceleration Backends

While the core remains Python, you can enable high-performance kernels through Python bindings:

```python

# Install FlashInfer for optimized attention

# pip install --index-url https://pypi.org/simple flashinfer-python

import flashinfer  # Python bindings enable fast KV-cache attention

```

The model automatically detects and utilizes these backends when available, requiring no manual compilation of C/C++ extensions by the user.

## Summary

- **LingBot‑Map is a pure Python codebase** requiring Python 3.10 or newer according to [`pyproject.toml`](https://github.com/Robbyant/lingbot-map/blob/main/pyproject.toml).
- All core logic resides in `.py` files, including the `GCTStream` model definition in [`lingbot_map/models/gct_stream.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/models/gct_stream.py).
- The framework operates entirely within the Python interpreter, using PyTorch for tensor computations.
- Optional performance libraries like FlashInfer are accessed via Python bindings, preserving the primary language as Python.

## Frequently Asked Questions

### Is LingBot‑Map written in C++ or Python?

LingBot‑Map is written entirely in **Python**. While the framework can leverage optional C++ kernels (such as FlashInfer) through Python bindings, every source file in the Robbyant/lingbot-map repository is a Python module. The core transformer architecture, data loading utilities, and inference loops are implemented in pure Python using PyTorch.

### What Python version does LingBot‑Map require?

The project requires **Python 3.10 or higher**, as specified in the [`pyproject.toml`](https://github.com/Robbyant/lingbot-map/blob/main/pyproject.toml) file. This version requirement ensures compatibility with modern PyTorch features and type hint syntax used throughout the codebase.

### Can I run LingBot‑Map without compiling C++ extensions?

Yes. LingBot‑Map runs as a pure Python package without any mandatory compilation steps. The [`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py) script and model classes function entirely within the Python interpreter. Optional acceleration libraries provide performance boosts but are not required for basic functionality.

### Does LingBot‑Map use PyTorch?

Yes. LingBot‑Map is built on **PyTorch** and uses it for all tensor operations and neural network layers. The `GCTStream` class in [`lingbot_map/models/gct_stream.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/models/gct_stream.py) inherits from PyTorch modules and uses `torch.load()` for checkpoint management, `torch.device()` for hardware placement, and standard PyTorch inference patterns.