/images/avatar.jpg

Self-Hosting a ChatGPT Web UI

ChatGPT is an AI-powered interactive bot that chats with users and helps them — answering questions, translating between Chinese and English, and offering jokes, philosophy, maxims and more. It can also learn and remember your preferences and habits to serve you in a more personalized, professional way. This post covers the relevant principles, a few competitors, environment setup, and use cases.

Go OTP TOTP HOTP

More and more systems add multi-factor authentication for security. OTP is one of the relatively simple and convenient MFA schemes. This post briefly covers the concepts and gives totp and hotp examples based on go1.19.2. For more, see kit4go/otp.

Go Object Pool Usage & Optimization — Theory

Go object pools reuse temporary objects, which reduces the waste from frequently creating them — i.e. lower GC overhead and memory usage — improving performance and lowering serving cost to some extent. Based on go1.18.2, this post covers use cases, the processing flow & caveats, open-source examples, a personal example (incl. pooling under gRPC), and best practices.

Go Kafka Consumer Group Usage

Based on Go 1.18 and Kafka 2.4.1, this post consumes messages via a Kafka Consumer Group, provides a best-practice example and configuration tips, and reduces timeout issues caused by Rebalance.

Pyroscope: Continuous Profiling for Go

Pyroscope is an open-source continuous-profiling platform. It supports many languages (Go, Python, Rust, Java, …), runs on multiple platforms with multiple deployment options, ships a handy visual-analysis UI, powerful data querying/analysis/storage, configurable data-eviction policies, and both Push and Pull modes. It can export to several formats (png, json, pprof, html, flamegraph.com) and can be displayed inside grafana.