A Font of Knowledge
Is it a font, a large language model, or an inference engine? Yes. The llama.ttf font packages up a chatbot as a font for easy use.
OpenAI’s ChatGPT was by no means the first large language model (LLM) to be developed, but it was the tool that brought LLMs into the mainstream. The release of this chatbot led to a modern-day gold rush in which many organizations raced to develop their own LLMs, each trying to outdo their competitor’s latest release. During this initial frenzy it often seemed almost as if this goal was being sought after with little thought about what practical applications these models would actually be used for.
Much of that overzealousness is still apparent today, yet with time to step back and consider the possibilities, more concrete applications are also emerging. One of the more popular applications of LLMs at present is taking the form of a tool that is embedded in email clients and word processors that assists users with their writing. A typical architecture of such an application involves API calls to a remote, cloud-based server that responds to user prompts before the local application parses the response and inserts it into the text editor window.
A mathematician named Søren Fuglede Jørgensen had a very strange, yet also quite interesting (but mostly strange), idea for a new way to integrate LLMs into text editors. Jørgensen developed a tool called llama.ttf, and as the name implies, it is a font. But it is also an LLM. And an inference engine. Yes, all in a font. I did mention that it was strange, didn’t I?
This odd hack will work with any application that leverages the font shaping engine called HarfBuzz, which is a pretty long list, and includes some notable applications like Google Chrome. HarfBuzz includes a web assembly shaper that can execute arbitrary code, which is meant to give flexibility in defining text shapes. But in this case, Jørgensen stuffed an entire LLM (TinyStories, 15 million parameters) and inference engine into the font file.
Is anyone else’s spider sense tingling right about now? If you can transparently run an LLM in a HarfBuzz font, what else could you run? Or what else might already be running? But setting that aside for a moment, the result in this case is llama.ttf, an intelligent font. By simply choosing to use what appears to be a standard font, one can then type certain keywords, like “abracadabra,” and characters with special meaning, like an exclamation point, and text completion features just start to happen.
Weirdness aside, with some refinement, llama.ttf could actually be a very appealing way to package up an LLM for many use cases. It just works in a variety of existing applications, and does not require sending any private data to unknown cloud-based systems for purposes that are never entirely clear. If you want to dig deeper, check out Jørgensen’s project write-up and GitHub repository.