R&D
A Guide to Designing and Implementing LLM Applications
· β˜• 6 min read
1. Problems with Using LLMs Directly Unstable output One characteristic of generative AI is the diversity of its output. Ask an LLM the same question several times and you may get different answers. This uncertainty in output is a pleasant surprise for users in conversation and creative scenarios. But in

My Restful API Specification
· β˜• 2 min read
Mainly for standardizing the APIs I write myself, and also to help LLMs understand my APIs better. 1. Domain Use a dedicated domain whenever possible, for example api.example.com. 2. Path Always use lowercase letters. Do not include an /api prefix. Do not include file extensions. Do not put / at the end.

OpenAI Vs Azure OpenAI API
· β˜• 3 min read
Because pricing and limits change over time, this article is only a reference for the time it was written. 1. Terminology RPM (requests per minute) Requests per minute RPD (requests per day) Requests per day TPM (tokens per minute) Tokens per minute TPD (tokens per day), Tokens per day

Optimizing Go Applications in Containers
· β˜• 3 min read
1. Memory Alignment Arrange the fields inside a struct from largest to smallest. This reduces memory footprint. Install the fieldalignment tool 1 go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest Analyze and fix memory alignment 1 2 3 4 5 6 7 8 9 fieldalignment -fix ./... /Users/shaowenchen/Code/app/config/config.go:136:14: struct with 32 pointer bytes could be 24 /Users/shaowenchen/Code/app/config/config.

Some Tips for Optimizing Program Builds
· β˜• 3 min read
Continuously updated… 1. Golang Use trimpath to remove the build path, avoiding exposure of build path information 1 go build -gcflags="all=-trimpath=${PWD}" -asmflags="all=-trimpath=${PWD}" -o ./bin/opscli ./cmd/cli/main.go Before adding it, a panic prints the path /Users/shaowenchen/Code/Github/ops/main.go; after adding it, a panic prints main.go. -ldflags “-w -s” removes debug information and reduces the binary size 1 go build -ldflags "-w -s" -o .