Mindket

Lexnet

Newversion 1 · updated

Overview

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 . Download it on this page, a zip of its files. Nothing in it runs by itself.

At a glance

You need
  • 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
Runs in
  • 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
Start with
pip install -U huggingface_hub
hf download alpindale/lexnet

Platform

WindowsOperating system
macOSOperating system
LinuxOperating system

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.

IndustryWho uses itHow they use itExample
Developer toolsEditor and tool buildersHighlight C code quicklyA highlighter inside a small viewer
ResearchML researchersStudy a network with designed weightsReading how its recurrent units work
EducationStudentsSee a network do a real parsing taskTracing how one byte gets its class
Performance workEngineersCompare it with other highlightersSpeed 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 caseWhoWhat they get back
Highlighting C filesTool buildersOne class id per byte of the source
Speed testsEngineersTiming figures against other highlighters
Study of a small networkResearchersA 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.
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.

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.

  1. You compile the small C program
  2. You pass the weights and a C file
  3. The network tags each byte with a class
  4. 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
numpy reference59 K chars/s
Pygments CLexer2,238 K chars/s
lexnet interpreted2,398 K chars/s
tree-sitter parse and highlight10,010 K chars/s
lexnet compiled kernel11,326 K chars/s
tree-sitter parse only19,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 and files

README

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.

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.
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.

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
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

Get the model

Download its files with Hugging Face's command line:

pip install -U huggingface_hub
hf download alpindale/lexnet

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

Files
README.md  5 KB

1 file, 5 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-14

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Bonsai-27B-GGUF

lmstudio-community · Kit

A GGUF conversion of the 27B Bonsai model for LM Studio, with a 3.80 GB Q1_0 language file and a 0.93 GB BF16 vision projector. Tested for text, vision and par…

New

Runs DeepSeek-V4.1-Flash-1017 as a 2.9 bits-per-weight EXL3 quantization, a 196 GiB copy for people serving large models on their own hardware. Perplexity stay…

New

MusicGen Small

facebook · Kit

Generates short music clips from a text description or an audio prompt, in the small checkpoint of facebook's MusicGen. It suits developers and music hobbyists…

New

Similar in Developer

See all in Developer

FLUX.2 Klein LoRA Studio

prithivMLmods · Kit

Try a set of LoRAs for the FLUX.2 Klein image model in a Gradio app that runs in your browser or on your own computer. Made for people who make or test AI imag…

New

anaksor-ocr

Sokheng · Kit

Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…

New

Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…

New