Skip to content

2024

Running Local Model with Ollama

Sometimes, I need to run a model locally on my machine. This is useful for debugging and testing purposes.

This guide will show you how to run a model locally using Ollama.

Stop or Kill a Thread

It is generally a bad pattern to kill a thread abruptly, in Python, and in any language.

The nice way of handling this, if you are managing your own thread, is to have an exit flag that each thread checks on a regular interval to see if it is time to exit:

Source Code Batch Changes

Sometimes, existing code needs to be modified in batches, and these operations are too complex to be achieved through the IDE's replacement function.

AST is a good choice to do that.