From the course: Responsible Generative AI and Local LLMs

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Developing cosmopolitan

Developing cosmopolitan

- [Instructor] This is a library called Cosmopolitan, which is at the core of llamafile, which allows it to be a portable large language model. So let's go ahead and take a look at how this actually works. We have here the Cosmopolitan Libc makes a C build-once, run-anywhere language like Java, right? So that's one of the cool things about it. So all you need to do is unzip it, go to the releases right here, unzip it, and then use this Cosmo compiler, right, where we say cosmocc -o hello. This will be the output, and the C file will be hello.c. And what's also kind of cool is that for old school Unix people, you can see that there's an strace facility here as well. So you can actually see what's actually happening underneath the hood. This was a utility that a lot of sysadmins would use back in the day, but it's also very useful in modern times as well to really dig into all the calls that are happening in a piece of code. So let's go ahead and take a look at how we would do this. So…

Contents