# Categorizing Data with Large Language Models in Rust

DevFeed: [Categorizing Data with Large Language Models in Rust](<https://devfeed.tech/articles/categorizing-data-with-large-language-models-in-rust-22248.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/07/categorize_data_large_language_model_rust.html>)

Published: 2024-08-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Internet Traffic](<https://devfeed.tech/topics/internet-traffic.md>), [Network](<https://devfeed.tech/topics/network.md>), [netflow](<https://devfeed.tech/topics/netflow.md>), [domain](<https://devfeed.tech/topics/domain.md>), [Mercury](<https://devfeed.tech/topics/mercury-lang.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [data](<https://devfeed.tech/tags/data.md>), [llama](<https://devfeed.tech/tags/llama.md>), [llm](<https://devfeed.tech/tags/llm.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [networks](<https://devfeed.tech/tags/networks.md>), [ollama](<https://devfeed.tech/tags/ollama.md>), [rust](<https://devfeed.tech/tags/rust.md>), [traffic](<https://devfeed.tech/tags/traffic.md>)

## AI overview

LibreQoS tracks network flows by ASN, but ASN names alone may not tell operators which services users are reaching. The article prepares ASN data for automated categorization using ipinfo.io's downloadable CSV: a Rust program with Serde and CSV reads the domain field, yielding 412,795 entries from a 420,772-line file. Because many domains are duplicates, it recommends sorting and retaining unique strings rather than inserting them into a hash set, which it says is substantially slower due to string hashing. The excerpt ends during the deduplication implementation and does not show how categorization is performed.

## Source excerpt

Introduction LibreQoS is an open source project for monitoring and providing quality-of-experience for Internet Service Providers (ISPs) and large networks. It runs as a "middle-box", monitoring traffic that passes through it. It recently gained the ability to track individual data flows - connections between two endpoints. It's also my favorite Open Source project, to which I contribute regularly. Public Internet IP addresses belong to an ASN - an Autonomous System Number. An ASN is a unique number that identifies a network on the Internet. Tracking flows allows you to see which ASNs your users are connecting to, how much data is flowing, and monitor the quality of the connection.