Command-line LLM chatbot demo
https://github.com/yinchi/openai_demo
This simple chatbot uses the OpenAI Chat Completions API to generate responses to user input. Responses are interpreted as Markdown and rendered in the terminal using the rich Python library. Available tools include file read/write, Python code execution, and web search via the Brave Search API.
The chatbot was tested locally using a vLLM instance running the
google/gemma-4-26B-A4B-it model. A
gemma.sh script is included in the repo to simplify the process of launching the vLLM
instance with the correct parameters.

CodeCrafters
https://app.codecrafters.io/users/yinchi
CodeCrafters is a website filled with coding challenges involving recreating simplified versions of common software such as an HTTP server, a terminal shell, a programming language interpreter, and a CLI LLM tool. The profile page above tracks my progress through various challenges offered by the website.
Published challenge solutions:
- Rust: interpreter — follows Part II of the book Crafting Interpreters by Robert Nystrom, building a tree-walk interpreter for the Lox programming language. Features include a finite-state-machine tokenizer, a recursive-descent parser, and a resolver for handling variable scopes. The language is a simple dynamically-typed language with Python-like syntax, functions, classes, and inheritance.
- Rust: HTTP Server — a simple HTTP/1.1 static file server that can handle multiple concurrent, persistent connections.
- Python: CLI LLM tool — this challenge is still in beta on the CodeCrafters website but uses the OpenAI API to communicate with an LLM. A small set of available tools are advertised. As a permissions system was not implemented as part of this challenge (it has been proposed as a future extension), I stuffed my local test environment inside a Docker container for isolation.
Other projects
Ring puzzle
Clone of the classic Top Spin puzzle by Binary Arts. Auto-solver included based on a greedy algorithm plus endgame table lookup. Full blog post here.
μpy
MicroPython in a Docker container, all under 10MB!
I made this because the current pre-built micropython/unix Docker image on
Docker Hub is hardly smaller than a typical
python image. One can use my Docker image to test an MQTT IoT network setup with a large
number of virtual sensors; the example script included in the repo can be used for this.
The included Dockerfile sets up MicroPython and also installs a small set of MicroPython
packages (required by the example script).
Code for paper “Data integration for space-aware Digital Twins of hospital operations”
This code accompanies the Automation in Construction paper
“Data integration for space-aware Digital Twins of hospital operations”.
It simulates the handling of specimens in a histopathology laboratory, and examines the effect
of building layout and infrastructure status on the lab turnaround time. The
salabim Python library is used for
discrete-event simulation.
HarvardX PH125.9x: Movielens Project
R project for partial completion of the edX course HarvardX PH125.9x: “Data Science: Capstone”.
The objective of this project was to build a movie recommendation system using the MovieLens dataset. The final model presented uses linear regression with matrix factorisation on the residuals, and achieves a root mean squared error of 0.782 when estimating the ratings (out of 5) of movies in the test set.
To accelerate the matrix factorisation portion, I used Rcpp along with the Armadillo C++ library to implement Simon Funk’s matrix factorisation algorithm.
HarvardX PH125.9x: Higgs dataset classification
R project for partial completion of the edX course HarvardX PH125.9x: “Data Science: Capstone”.
In this project, neural networks (via Keras in R) were used to predict particle collision events using the HIGGS dataset. The final NN was generated with three hidden layers of 2048 nodes each, generating a final area under the ROC curve (AUC) of 0.877. It was found that using high-level (derived) features provided only a small improvement in AUC, compared to using low-level features only.
SimPy Examples
These short examples were created to teach discrete-event simulation to Electrical Engineering final-year project students at the City University of Hong Kong. The SimPy Python library was used for this purpose. SimPy is based on the use of Python generators and an Environment object that is shared between components of the simulation.