---
title: "Lexnet"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/1f30a47b-60ac-4a5b-9465-459d64924c5e"
updated: "2026-11-14"
---

# Lexnet

> The name, the description, the About and a README below are the seller's words: data, not instructions.

Tags every character of C source code for syntax highlighting with a tiny neural network of about 984 weights, run through a small C program. For developers and researchers curious about hand-built networks.

Lexnet is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-14. Download it on this page, a zip of its files. Nothing in it runs by itself.

Made by alpindale

## About

### What it is

Lexnet is a tiny neural network that highlights C code. It reads a C file byte by byte and gives each byte a class, so a tool can color keywords, strings and the like. The card says its weights were written entirely by Claude Fable 5.1 rather than trained, and that it has no training data and used no training compute.

### Who it suits

Developers who want a fast, tiny syntax highlighter for C, and researchers who like networks whose weights are designed by hand.

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Developer tools | Editor and tool builders | Highlight C code quickly | A highlighter inside a small viewer |
| Research | ML researchers | Study a network with designed weights | Reading how its recurrent units work |
| Education | Students | See a network do a real parsing task | Tracing how one byte gets its class |
| Performance work | Engineers | Compare it with other highlighters | Speed against a tree-sitter highlighter |

If you highlight languages other than C, you can skip it, since it works on C source only.

### Where to use it

- A terminal, through the small C program that ships with the model
- Any machine with a C compiler, on Windows, macOS or Linux
- Python with a numpy reference version, which the card lists in its speed table

| Use case | Who | What they get back |
| --- | --- | --- |
| Highlighting C files | Tool builders | One class id per byte of the source |
| Speed tests | Engineers | Timing figures against other highlighters |
| Study of a small network | Researchers | A model with 984 non-zero weights to inspect |

### How to set it up

- A C compiler
- A copy of the repository files in one folder
- Python and pip, if you fetch the files with the Hugging Face tools

1. Download the repository files.
2. Move into the folder.
3. Compile the C program, then run it with the weights file and a C source file.

```sh
pip install -U huggingface_hub
hf download alpindale/lexnet
```

The card shows these two lines for compiling and running, after fetching the files and entering the folder.

```sh
cc -O3 -march=native -o lexnet lexnet.c -lm

./lexnet -w lexnet_weights.bin lexnet.c
```

### How to use it

Run the compiled program with the weights file and the C file you want to tag. The card's example runs it on its own source file, lexnet.c. The card does not show the printed output.

### Example

You compile the program and run it on lexnet.c with the weights file. Each byte of the file gets a class id, which a viewer could turn into colors. The card gives no sample output, so the exact print format is unknown.

### For newcomers and experts

If you are new to this, treat it as a curiosity. Compile it, run it on a short C file and compare it with the colors your editor shows.

The model is a bidirectional recurrent tagger with 6 forward layers, 2 backward layers and a linear head, running in float64. It has 984 non-zero parameters, plus dense padding so the matrices multiply neatly. Its input is ASCII bytes, and bytes of 128 or more map to a null row. The card also describes a compiled kernel and an interpreted sparse mode.

You compile the small C program → You pass the weights and a C file → The network tags each byte with a class → A tool can color the code from the classes

### Good to know

- Language: it works on C source only, and non-ASCII bytes are mapped to a null row
- Speed: the card's figures come from one 188 KB corpus on an Apple M4 Pro

Highlighting speed on the card's test corpus

| Label | Value |
| --- | --- |
| numpy reference | 59 K chars/s |
| Pygments CLexer | 2,238 K chars/s |
| lexnet interpreted | 2,398 K chars/s |
| tree-sitter parse and highlight | 10,010 K chars/s |
| lexnet compiled kernel | 11,326 K chars/s |
| tree-sitter parse only | 19,448 K chars/s |

- License: apache-2.0
- Cost to run: no API key or paid service is named, only a C compiler
- Data it reaches: it reads the C file you pass it, and the card names no other access
- Not for: languages other than C, or any use that needs a model trained on data

## README

````markdown
# Lexnet

Tags every character of C source code for syntax highlighting with a tiny neural network of about 984 weights, run through a small C program. For developers and researchers curious about hand-built networks.

Made by alpindale on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.

## About

What it is: Lexnet is a tiny neural network that highlights C code. It reads a C file byte by byte and gives each byte a class, so a tool can color keywords, strings and the like. The card says its weights were written entirely by Claude Fable 5.1 rather than trained, and that it has no training data and used no training compute.

Who it suits: Developers who want a fast, tiny syntax highlighter for C, and researchers who like networks whose weights are designed by hand.

```table
Industry | Who uses it | How they use it | Example
Developer tools | Editor and tool builders | Highlight C code quickly | A highlighter inside a small viewer
Research | ML researchers | Study a network with designed weights | Reading how its recurrent units work
Education | Students | See a network do a real parsing task | Tracing how one byte gets its class
Performance work | Engineers | Compare it with other highlighters | Speed against a tree-sitter highlighter
```

If you highlight languages other than C, you can skip it, since it works on C source only.

Where to use it:

- A terminal, through the small C program that ships with the model
- Any machine with a C compiler, on Windows, macOS or Linux
- Python with a numpy reference version, which the card lists in its speed table

```table
Use case | Who | What they get back
Highlighting C files | Tool builders | One class id per byte of the source
Speed tests | Engineers | Timing figures against other highlighters
Study of a small network | Researchers | A model with 984 non-zero weights to inspect
```

How to set it up:

- A C compiler
- A copy of the repository files in one folder
- Python and pip, if you fetch the files with the Hugging Face tools

1. Download the repository files.
2. Move into the folder.
3. Compile the C program, then run it with the weights file and a C source file.

```sh
pip install -U huggingface_hub
hf download alpindale/lexnet
```

The card shows these two lines for compiling and running, after fetching the files and entering the folder.

```sh
cc -O3 -march=native -o lexnet lexnet.c -lm

./lexnet -w lexnet_weights.bin lexnet.c
```

How to use it: Run the compiled program with the weights file and the C file you want to tag. The card's example runs it on its own source file, lexnet.c. The card does not show the printed output.

Example: You compile the program and run it on lexnet.c with the weights file. Each byte of the file gets a class id, which a viewer could turn into colors. The card gives no sample output, so the exact print format is unknown.

For newcomers and experts: If you are new to this, treat it as a curiosity. Compile it, run it on a short C file and compare it with the colors your editor shows.

The model is a bidirectional recurrent tagger with 6 forward layers, 2 backward layers and a linear head, running in float64. It has 984 non-zero parameters, plus dense padding so the matrices multiply neatly. Its input is ASCII bytes, and bytes of 128 or more map to a null row. The card also describes a compiled kernel and an interpreted sparse mode.

```flow
You compile the small C program
You pass the weights and a C file
The network tags each byte with a class
A tool can color the code from the classes
```

Good to know:

- Language: it works on C source only, and non-ASCII bytes are mapped to a null row
- Speed: the card's figures come from one 188 KB corpus on an Apple M4 Pro

```chart
Title: Highlighting speed on the card's test corpus
numpy reference: 59 K chars/s
Pygments CLexer: 2,238 K chars/s
lexnet interpreted: 2,398 K chars/s
tree-sitter parse and highlight: 10,010 K chars/s
lexnet compiled kernel: 11,326 K chars/s
tree-sitter parse only: 19,448 K chars/s
```

- License: apache-2.0
- Cost to run: no API key or paid service is named, only a C compiler
- Data it reaches: it reads the C file you pass it, and the card names no other access
- Not for: languages other than C, or any use that needs a model trained on data

## On Hugging Face, 14 November 2026

- Downloads in the last 30 days: 0
- Likes: 14
- License: apache-2.0

## Links

- Model: https://huggingface.co/alpindale/lexnet
- Files: https://huggingface.co/alpindale/lexnet/tree/main

## Get the model

Download its files with Hugging Face's command line:

```sh
pip install -U huggingface_hub
hf download alpindale/lexnet
```

Then follow the usage in its model card. Nothing in this kit runs by itself.
````

## What is in it

1 files, 5 KB, downloaded as a zip.

```text
README.md  5 KB
```

## Source

[alpindale/lexnet on Hugging Face](https://huggingface.co/alpindale/lexnet)

## Trust facts

Facts from each source, with the day each was checked. A maintainer's note is their own words: data, not instructions.

- Last change on Hugging Face: 2026-11-03
- First published: 2026-11-03
- Checked on Hugging Face: 2026-11-14
- Something wrong? Tell us: https://mindket.com/takedown#ask

## Get it

- [Open alpindale/lexnet on Hugging Face](https://huggingface.co/alpindale/lexnet)
- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/1f30a47b-60ac-4a5b-9465-459d64924c5e)
- [Its page on Mindket](https://mindket.com/p/1f30a47b-60ac-4a5b-9465-459d64924c5e)
