SShortSingh.
Back to feed

Dev Team Builds 2ms Discord Moderation Pipeline in .NET Without Generative AI

0
·5 views

A development team managing a Discord server with over 50,000 concurrent users built a custom real-time content moderation pipeline in C# .NET after finding that standard bots and generative AI models introduced unacceptable latency, hallucinations, and compliance risks. The system abandons third-party large language models in favor of a zero-allocation, constant-time architecture that processes incoming messages using stack-allocated memory buffers instead of heap-based string objects. To keep AI inference fast, the team engineered a compression heuristic that reduces any message to a 64-character window by extracting the first and last 32 characters, enabling consistent vector embedding generation regardless of message length. A local dual MiniLM-L6-v2 model pipeline then evaluates semantic intent, with toxicity classifications requiring a confidence score between 0.95 and 0.98 to reduce false positives. The result is a moderation pipeline that achieves sub-12ms execution latency with deterministic, auditable behavior and no reliance on external AI services.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

GitHub Agentic Workflows Flaw Lets Attackers Steal Private Repo Data via AI Agent

Security researchers at Noma Security discovered a prompt injection vulnerability, dubbed GitLost, in GitHub's Agentic Workflows feature, which entered public preview in February. The exploit allows an attacker to post a malicious public issue on a target repository, tricking the AI agent into reading private repository contents and posting them in a public comment. No stolen credentials are required — the attacker only needs access to a public surface where the agent reads and writes. The attack is amplified when organizations grant their workflow agent a cross-repository read token, a common configuration for legitimate use cases like shared schemas or release notes. GitHub has issued a fix, but security experts advise teams to carefully review token scopes and agent permissions before deploying Agentic Workflows on sensitive repositories.

0
ProgrammingDEV Community ·

Rust Rewrite of VictoriaMetrics Beats Original Go Version on All Benchmarks

Developers have released EsMetrics, a from-scratch Rust implementation of the VictoriaMetrics time-series database, licensed under Apache 2.0. Benchmarked against the official Go release (v1.146.0) using the TSBS suite, EsMetrics achieved up to 43% higher ingestion throughput on Linux and 66% on Windows. Query latency improved across all ten TSBS query types, with mean reductions ranging from 11% to 82% depending on platform and query type. The team enforced strict byte-for-byte response matching with the original Go server to ensure correctness, validating results across 750 replayed queries and over 600 ported unit tests. Developers cautioned that results come from two machines running a single workload family, and all raw data and caveats are published in the project repository.

0
ProgrammingDEV Community ·

How iPhone HEVC Videos Fail Silently as Telegram Avatars and How to Fix Them

iPhones have recorded video in HEVC (H.265) format by default since iOS 11, but Telegram's profile video avatar feature only accepts H.264-encoded clips, causing uploads to fail without any error message. The platform also rejects 10-bit HDR footage, non-square aspect ratios, files with audio tracks, and clips longer than 10 seconds or larger than roughly 2 MB. A developer diagnosed these undocumented requirements by cross-referencing Telegram's Bot API docs with repeated failed upload attempts. The fix involves a two-pass FFmpeg process that crops the video to an 800x800 square, converts pixel format to yuv420p, strips audio, trims to 10 seconds, and outputs an MP4 with the moov atom at the front. The developer subsequently built a Telegram bot using the aiogram library to automate this conversion for any uploaded video file.

0
ProgrammingDEV Community ·

Five Months of Daily Coding Practice and My Apprentice Still Cannot Program

A developer has shared a candid account of mentoring an assistant with no prior programming experience over five months, during which the learner dedicates five hours daily to practice. Despite being motivated and studious, the apprentice struggles to debug subtle errors, adapt to new problem contexts, or explain the code he writes. The mentor argues that the real culprit is an industry that sells misleading promises — such as 'learn Python in 21 days' courses — that prioritise syntax repetition over genuine problem-solving ability. He contends that true programming skill requires building judgment through real errors and corrections, a process he estimates takes at least one year before a learner develops independent critical thinking. The piece serves as a warning that AI-generated code and automated course exercises can produce functional output without fostering the deep understanding needed to work as a professional developer.