Hi there!

Plain living and high thinking, with code as a companion.

Run a large language models locally (3) - Enabling the Model to Use Tools Autonomously

This article is the third in a series on running large language models (LLMs) locally. In the previous two articles, we introduced how to run Ollama locally and how to fine-tune the model’s answers by providing an external database. This article will continue to explore how to use the function-calling feature to extend the model’s capabilities and make it go further on the road to “intelligence”. Function-calling According to the OpenAI official documentation, function-calling is a way for large language models to connect to external tools. In short, developers provide the model with a number of tools (functions) in advance. After the model understands the user’s question, it decides whether to call the tool to obtain more context information to help the model make better decisions. ...

2024-03-07 · caol64

Run a large language models locally (2) - Providing an External Knowledge Base to the Model

In the previous article, we demonstrated how to run large language models (LLMs) locally using Ollama. This article focuses on enhancing LLM accuracy by allowing them to retrieve custom data from external knowledge bases, making them appear “smarter.” This article involves the concepts of LangChain and RAG, which will not be explained in detail here. Prepare the Model Visit Ollama’s model page, search for qwen, and this time we will use the “Tongyi Qianwen” model, which has a better understanding of Chinese semantics, for the experiment. ...

2024-03-04 · caol64

Run a large language models locally

With the rise of ChatGPT, LLMs (Large Language Models) have become a hot topic in the field of artificial intelligence and natural language processing. In this article, I will walk you through the process of running a large language model on your own personal computer. Pros and Cons There are many advantages to running a large language model locally: Privacy protection No expensive costs Ignore network problems Try out various open source models I think the first two advantages are enough for everyone to try. Everyone has some private data that they don’t want to send to third parties. If you can use AI to process private data locally or even offline, isn’t that perfect? In addition, locally, no matter how much data you run, you don’t need to pay for API and token fees. Are you excited? ...

2024-02-27 · caol64

Got the "JetBrains" Open-Source Free License

Remember three months ago I open-sourced the ps2mc-browser project on GitHub, a magical little tool that can view and render 3D icons of PS2 archives. Occasionally pushing code, adding features, and now finally releasing its first stable version. Then I turned my attention to JetBrains’ “Open Source Development Licenses”. JetBrains Licenses for Open Source Development JetBrains is a company dedicated to building the most intelligent and efficient development tools. They offer a program called “Open Source Development Licenses” to support developers who contribute to the open-source community. ...

2023-12-31 · caol64

"ps2mc-browser" Shader Code Analysis

How do we render the vertices and textures of polygons into a colorful scene? This is where OpenGL shaders come into play. Today, we’ll discuss the shaders of ps2mc-browser. To briefly introduce, ps2mc-browser is a PS2 memory card viewer capable of parsing vertex and texture data from 3D icons within PS2 memory card files and rendering them using OpenGL. In the following content, I’ll dissect the six OpenGL shaders used in ps2mc-browser one by one. Let’s dive into understanding how they work. ...

2023-12-20 · caol64

"ps2mc-browser" New Feature Release

ps2mc-browser is a PS2 memory card file viewer that utilizes an OpenGL canvas to display 3D dynamic icons from the memory card. It relies on the following dependencies: Python3 WxPython Numpy ModernGL PyGlm You can find the GitHub repository here. New Features Some PS2 game memory card files contain three sets of different animated icons, corresponding to three different operations: “browse,” “copy,” and “delete.” ...

2023-11-20 · caol64

PS2 Texture Image Encoding Algorithm "A1B5G5R5"

In the previous article, we discussed the RLE image compression algorithm used in PS2. This time, let’s delve into its texture mapping encoding algorithm—A1B5G5R5. Introduction For textures, common image encoding formats like jpg or png are not suitable. This is because images are read and rendered by the GPU. You wouldn’t want to send a jpg image over and have the GPU decode the entire image just to read one pixel, right? Therefore, the most ideal image format is an uncompressed bitmap format, allowing direct access to RGB data based on pixel coordinates. The A1B5G5R5 format we’re introducing today is one such encoding format. ...

2023-10-20 · caol64

The Application of the RLE Algorithm in PS2

Introduction to RLE Algorithm The RLE (Run Length Encoding) algorithm is a compression method that represents file content in the form of “number of repetitions x data.” For example: given the data AAAAAABBCDDEEEEEF, by appending the number of consecutive occurrences after each character, it can be represented as 6A2B1C2D5E1F. It can be observed that the original data is 17 bytes, while the encoded data is 12 bytes, thus achieving successful compression. ...

2023-10-16 · caol64

Rendering PS2 Savegame 3D Icons using Python and OpenGL

After a series of previous articles laying the groundwork, the files for PS2 savegame 3D icons have all been parsed. In this article, we will begin to explore how to render the 3D icons using the following tools, aiming to achieve a rendering as close as possible to the original effect on the PS2 console. ...

2023-10-09 · caol64

Analysis of the PS2 Game Save 3D Icons

Seeing this image, it shouldn’t be unfamiliar to seasoned players familiar with PS2. It’s the 3D icon of a game save file from the PS2 memory card management interface. In this article, we will introduce how to extract the character model from the save file. 01 Parsing Objectives A: What can we parse from the save file? ...

2023-10-04 · caol64