Shing Lyu

Disclaimer: This content reflects my personal opinions, not those of any organizations I am or have been affiliated with. Code samples are provided for illustration purposes only, use with caution and test thoroughly before deployment.

My New Book: Practical Rust Projects, 2nd Edition

Hi, everyone! I hope you are all doing well and enjoying Rust as much as I do. I have some exciting news to share with you today: I have just published my new book, Practical Rust Projects, 2nd Edition.

Photo

I would like to acknowledge the contribution of my co-author, Andrew Rzeznik, who took over the project after I had to stop for personal circumstances. He did a fantastic job in finishing the book and making it even better than I could have imagined. I am very happy with the final outcome of our collaboration, and I hope you will find our book useful and enjoyable. Thank you, Andrew Rzeznik, for your hard work and dedication!

(continue reading...)


Getting Started with Rust llm-chain using the LLaMa driver

Recently I’ve been contributing to llm-chain, a Rust library for working with large language models (LLMs). It’s similar to Python’s LangChain. I contributed this tutorial to the official website for setting up a simple llm-chain using LLaMA models running locally using the llama.cpp project. I’m also publishing the same tutorial in this blog for archiving.


Tutorial: Getting Started using the LLAMA driver

In this tutorial, you will learn how to set up an llm-project using the LLAMA drive. If you wish to use the other drivers you can skip this part of the tutorial.

(continue reading...)


Using sepia theme in Brave's SpeedReader

I like Brave’s SpeedReader feature. It is a new approach to reader modes that removes unnecessary elements from pages it recognizes as articles and displays them in a simplified format as part of the rendering pipeline. Because it’s done during rendering, not after the page have rendered (as most reader mode extensions does), it delivers performance gain and reduce the network bandwidth required.

However, there is one thing that bothers me about SpeedReader. It follows the browser theme, so if you choose dark theme the SpeedReader theme is always white text on black, which is hard to read for me. I prefer a sepia theme for reading articles, as it is more soothing for my eyes. Unfortunately, there is no UI for changing the SpeedReader theme. However, I found this github issue. It shows that the theme has actually been implemented, but there is no way to access it from the browser settings. If you set the data-theme attribute on document.documentElement using JavaScript, you can toggle between dark, light and sepia themes.

(continue reading...)


How to create your own private LLM using only AWS CLI

In this blog post, I will show you how to use AWS CLI and SageMaker JumpStart to create your own private large language model (LLM) on Amazon SageMaker. You will learn how to deploy a pretrained model from the Hugging Face Transformers library, and how to use it to generate text with custom instructions using AWS CLI.

(continue reading...)


Disabling the Link Lost alarm on iTag BLE tracker

In this blog post, I will share my experience of using an iTag BLE tracker to find my lost TV remote and how I disabled the annoying link lost alarm feature.

What is an iTag BLE tracker?

An iTag BLE tracker is a small device that can be attached to any object and paired with a smartphone via Bluetooth Low Energy (BLE). It can be used as a key finder, anti-lost alarm, remote shutter, or voice recorder. It has a button that can trigger various actions on the smartphone, such as ringing, taking a photo, or recording a voice memo. It also has a built-in speaker that can beep when the Bluetooth connection is lost or when the button is pressed.

itag

I bought an iTag BLE tracker because I often lose my TV remote in the house, most of the time hidden somewhere by my toddler son. I wanted to use it as a simple device that can help me locate my remote by making a sound when I press the button on my smartphone. I thought it would be a cheap and easy solution for my problem.

(continue reading...)