I’ve been familiar with Python’s -m flag for a while but never had quite internalized what it was really doing. While reading about this cool AI pair programming project called aider, the docs mentioned that the tool could be invoked via python -m aider.main “[i]f your pip install did not place the aider executable on your path”. I hadn’t made this association between pip installed executables and the -m flag. The source for the file that runs when that Python command is invoked can be found here.
I was pulling the openai/evals repo and trying to running some of the examples. The repo uses git-lfs, so I installed that to my system using home-manager. { config, pkgs, ... }: let systemPackages = with pkgs; [ # ... git-lfs # ... ]; in { programs.git = { enable = true; lfs.enable = true; # ... }; }; After applying these changes, I could run git lfs install git lfs pull to populate the jsonl files in the repo and run the examples.
I spent yesterday and today working through the excellent guide by Alex on using sqlite-vss to do vector similarity search in a SQLite database. I’m particularly interested in the benefits one can get from having these tools available locally for getting better insights into non-big datasets with a low barrier to entry. Combining this plugin with a tool like datasette gives you a powerful data stack nearly out of the box.
The standard SQLite shell on macOS doesn’t support arrow key navigation like many standard CLI programs do. Pressing up, down, right, and left in that order outputs the following escape codes in the shell sqlite> ^[[A^[[B^[[C^[[D A program called rlwrap can shim arrow key support into sqlite. Install rlwrap (it’s supported by Homebrew and Nixpkgs) then run rlwrap sqlite <the rest of the command> and it should just work.
I use Simon’s llm to quickly run LLM prompts. This package is easily installed with brew or pip, so if you want to use it, I recommend those approaches. The following approach is not for the faint of heart and assumes a bit of familiarity with Nix and home-manager. We are going to install the llm including the llm-mistral plugin using Nix. It’s not particularly straightforward, but if you want to manage this tool with Nix, it appears to be possible.
I’ve been meaning to try out Simon’s llm package for a while now. From reading the docs and following the development, it’s a modular, meet-you-where-you-are CLI for running LLM inference locally or using almost any API out there. In the past, I might have installed this with brew, but we run nix over here now so everything is harder first, then reproducible. The llm package/cli is available as a few different nixpkgs
Devbox, is an interesting, nix-based tool for setting up reproducible development environments. I recently needed to quickly setup a postgres database and load the Chinook dataset to play around with some queries. I could have used Docker, but I am not a fan of its UI or how heavyweight it has become (looking into podman is also on my todo list) and I’ve been using nix a lot lately, which is what led me to the devbox project.
As I’ve fallen more down the rabbit hole, empowered by nix making it so easy to install, configure and manage any software, I discovered Alacritty as a fast, configurable terminal emulator. I’ve used and enjoyed iTerm2 for a while but it never hurts to try something new. I have some muscle memory built up for how my use my machine, so my aim was to configure something I could use comfortably in Alacritty, modeling it off of my iTerm setup.
I’ve used Hammerspoon as a window manager for almost 10 years. I decided to explore some of the newer tools in window management to see if I could find an alternative approach for what I do with Hammerspoon. Using yabai and skhd, I wrote the following skhdrc file that nearly reproduces the core functionality of my Hammerspoon window management code. I have four general window management use cases: halves quarters maximize move to another display Here’s how I implemented that with skhd hotkeys mapped to yabai commands:
This post is extremely similar to nix flakes and direnv. Here, I repeated my process, but with a little more thought and a little less language model magic. I setup my new computer to use nix, switching away from Homebrew, which I’ve used to manage and install dependencies on my system for about a decade. My goal was to unify my configuration management with my package management. Thus far, I’ve been quite satisfied.