# A Personal Lab for LLM Inference, GPU Efficiency, and Distributed Systems

> This repository from a Tsinghua-affiliated author bundles a from-scratch LLM inference stack, a GPU energy-aware runtime, two Raft implementations, quant trading backtests, and an interactive story. It is a broad personal archive rather than a single product, and its value depends on how much you want to read code over using a maintained tool.

**380992846-tech/Project-of-ChenShen** — LLM inference optimization, distributed systems, quantitative trading and creative workshop projects.

- Repository: https://github.com/380992846-tech/Project-of-ChenShen
- Stars: 199 · Forks: 0
- Language: HTML
- License: MIT
- Published: 2026-08-24 · Updated: 2026-08-24 · Language: en
- Canonical page: https://hysenlabs.com/projects/380992846-tech-project-of-chenshen

## What This Repository Actually Contains

The repository is not a single project but a collection of independent subprojects tied to a personal narrative. The README lists six main areas: a from-scratch decoder-only GPT with inference optimizations, a GPU energy-aware runtime called GEAR, two Raft implementations (one in C++17, one in Go with etcd for a thousand-node design), quant trading strategies for the JoinQuant platform, a local risk parity strategy, and an interactive HTML story called "The Story of ChenShen". There are also six knowledge notes on LLM and computer science topics. The unifying theme is that each piece is implemented from first principles, with benchmarks and tests claimed for the inference and GPU parts. The intended audience is someone who wants to see how these systems work internally, not someone looking for a drop-in library.

## The LLM Inference Optimizations: From KV Cache to Continuous Batching

The inference directory contains gpt.py, quantize.py, speculative.py, and continuous.py, plus benchmark.py and a reports folder. The README claims specific results: KV cache reduces decoding complexity from O(T^2) to O(T) with a measured speedup of about 3.6x. INT8/INT4/FP8 quantization compresses storage by 4 to 5 times with almost no perplexity loss. Speculative decoding lowers the target forward passes to 0.2 per token. Continuous batching gives near-linear throughput growth with batch size. These are strong claims, and the repository includes benchmark scripts to reproduce them, but the material does not specify the GPU model, batch sizes, or sequence lengths used. You should run benchmark.py yourself before trusting the numbers. The code layout suggests a clean separation: quant_compare.py compares quantization schemes, and cont_bench.py measures continuous batching. This is a good starting point for learning, but it is not a full inference server; it is a set of experiments.

## GEAR: A GPU Energy Runtime with DVFS and Power Capping

GEAR is a separate directory under GPU System. The software subdirectory contains DVFS, power capping, thermal management, and an ML-based frequency scaling component. There are scripts for calibration, benchmarking, and cost estimation. The README states the goal is to minimize energy without losing throughput, with a claimed 20 to 30 percent energy savings on training budgets, citing DeepSeek-V3's $5.6M cost as an example. The main entry point is GPU System/software/main.py, which you can run with --simulate --mode optimal. The simulate flag suggests that real hardware control is optional, which is a sensible safety measure. The runtime also measures recoverable waste heat, which is an unusual feature. The trade-off is that DVFS and power capping require kernel-level or driver-level access that may not work on all GPUs or in virtualized environments. The repository does not list supported GPU vendors or driver versions, so verify compatibility before relying on it.

## Two Raft Implementations: C++17 and Go with etcd

The repository contains two Raft implementations. The C++17 version implements election, log replication, persistence, and a KV state machine from scratch. The Go version scales up to a thousand nodes using etcd and a Multi-Raft architecture. The README describes this as a production architecture proposal, not a running system. The C++ code is likely a learning exercise, while the Go design addresses the operational complexity of multi-group Raft. The key difference from a single Raft group is that Multi-Raft splits the key space into shards, each with its own consensus group, which improves scalability but adds cross-group coordination. The material does not include benchmark results for the Go version, so the thousand-node claim is an architectural target, not a tested outcome. If you need a battle-tested distributed KV store, you should look at etcd itself or TiKV. This repository is for studying how Raft works under the hood.

## Quant Trading Strategies and the Interactive Story

The quant trading part includes strategies backtested on the JoinQuant platform, using random forests and XGBoost with SHAP. There is also a locally runnable multi-asset risk parity strategy with feature engineering and diagnostics. The quick start shows quant_v14.py for the JoinQuant backtest. The risk parity strategy is more portable because it does not depend on a specific platform. The interactive story, "The Story of ChenShen", is an HTML/CSS/JavaScript game with 16 chapters, a day-night cycle, a favorability system, an exploration map, and an ending gallery. It is a creative project, not a technical tool. The README says the story is about a large model becoming human. This subproject shows the author's range, but it is unrelated to the engineering content. For a quant researcher, the strategies are experimental and the README does not provide performance metrics, so treat them as educational examples.

## Getting Started: Commands, Dependencies, and Environment

The quick start section gives concrete commands. You install dependencies with pip install -r requirements.txt. For the Transformer training, run python Transformer与训练（从零实现）/train.py --config Transformer与训练（从零实现）/config.yaml. For inference benchmarks, run python LLM推理优化/benchmark.py, quant_compare.py, and cont_bench.py. GEAR runs with python GPU System/software/main.py --simulate --mode optimal. The quant strategy runs with python 量化策略（聚宽·回测）/quant_v14.py. The assistant package installs with pip install -e "助手与智能体（DeepSeek·CAMEL）" and launches with dsh-assistant voice, but it requires a DeepSeek API key. The story opens by starting 陈深的世界/game/index.html. For development, pip install -e .[dev] installs pytest, ruff, and mypy. The repository has GitHub Actions CI for lint, unit tests, and compile smoke tests, plus .editorconfig and .pre-commit-config.yaml. Docker and docker-compose are supported, though the README does not show a specific compose file.

## Limitations, Maintenance Cost, and Alternatives

The biggest limitation is that the repository is a personal archive, not a maintained product. The README lists roadmap items that are not done, such as true multi-machine distributed inference and unified engineering of the quant strategies. The last push date is unknown, so you cannot assume active maintenance. The license is MIT, which means you can reuse the code freely, but the copyright line says 2026, which is odd given the current date; verify the license file if you plan to redistribute. The C++ Raft implementation has tests, but the Go multi-raft design is only an architecture proposal. For inference optimization, an alternative is vLLM, which implements PagedAttention and continuous batching in a production-grade system. The repository mentions PagedAttention in its roadmap as completed, but vLLM is a full serving engine with a large community. For GPU energy management, alternatives like NVIDIA's DCGM or vendor-specific power capping tools are more mature. The quant strategies are tied to JoinQuant, so if you need a general backtesting framework, consider backtrader or zipline. The maintenance cost is low if you only read the code, but high if you try to integrate multiple subprojects into one system, because each has its own dependencies and assumptions.

## Conclusion

Adopt this repository if you are a student or researcher who wants to read and run self-contained implementations of LLM inference optimizations, a GPU DVFS runtime, and Raft consensus, all under one MIT license. Do not use it as a production dependency: the quant strategies target the JoinQuant platform, the assistant package needs a DeepSeek API key, and the distributed KV design is an architecture proposal without a live multi-node deployment. Before adopting any part, verify the benchmark scripts run on your hardware, confirm the GEAR runtime supports your GPU driver and power management interface, and check that the Raft Go code actually boots a cluster. The repository is a personal learning archive, so treat each subproject as a reference implementation to study, not as a maintained service.

## FAQ

### What is 380992846-tech/Project-of-ChenShen?

It is a personal research sandbox from a Tsinghua computer science student, described in its own metadata as covering LLM inference optimisation, distributed systems, quant trading and a creative workshop. The package description calls it an LLM implementation, quantitative trading, interactive web games and knowledge notes.

### What does the inference optimisation part of Project-of-ChenShen contain?

A from-scratch decoder-only GPT with KV cache, INT8, INT4 and FP8 quantisation, speculative decoding and continuous batching, alongside benchmark scripts and reports. The README's own table reports about 3.6 times from the KV cache path and 0.2 target forward passes per token with speculative decoding.

### Why is most of Project-of-ChenShen excluded from ruff linting?

The lint configuration comment explains that many historical research scripts, including the JoinQuant strategies, depend on platform magic global variables and have historical encoding problems. The stated policy is that ruff covers maintained and tested code, with legacy scripts to be migrated gradually.

### Can I pip install Project-of-ChenShen as a library?

Not as an importable package. The setuptools package list is empty, with a comment saying the in-repository scripts are organised under directories and are not distributed as a Python package. The pytest pythonpath setting adds three directories so tests can import those modules directly.

### What are the two Raft implementations in Project-of-ChenShen?

A C++17 version written from scratch covering election, log replication, persistence and a key value state machine, and a Go version scaled up to a thousand node architecture using etcd with Multi-Raft. The design document sits in a separate directory from both implementations.

### Where is the GEAR GPU energy runtime in Project-of-ChenShen?

The quick start gives a command to run it from a GPU System directory and the highlights section describes energy aware DVFS, power capping and temperature protection, but no GPU System directory appears among the repository's top level entries, so the path in the documentation does not currently resolve.

## Sources

- [Official README](https://github.com/380992846-tech/Project-of-ChenShen#readme)
- [Project repository](https://github.com/380992846-tech/Project-of-ChenShen)
- [README](https://github.com/380992846-tech/Project-of-ChenShen/blob/main/README.md)
- [Releases](https://github.com/380992846-tech/Project-of-ChenShen/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/380992846-tech-project-of-chenshen
