Method of differences and Newton polynomials
Eli Bendersky's website
by Eli Bendersky
2d ago
I was reading about Babbage's Difference engine the other day, and stumbled upon a very interesting application of the forward differences method. It turns out that if we get a sequence generated by a polynomial, under certain conditions we can find the generating polynomial from just a few elements in the sequence. For example, 0, 1, 5, 12, 22, 35, 51... is a sequence known as the pentagonal numbers, and we can use this technique to figure out that the polynomial \frac{3n^2}{2}-\frac{n}{2} generates it [1]. Notation Let's start with some mathematical notation. We'll call the underlying functi ..read more
Visit website
Summary of reading: January - March 2024
Eli Bendersky's website
by Eli Bendersky
2w ago
"Lessons in Chemistry: A Novel" by Bonnie Garmus - a research chemist finds her way in the world following multiple personal tragedies and facing extreme gender discrimination. I have some mixed feelings about this book. On one hand it's original, enternaining, well-written and thought provoking. On the other hand it's full of shallow plot twists and extreme characters tuned all the way to 11. I sort of understand some of this is done on purpose to make a point, maybe a bit like in "Atlas Shrugged"; that said, this book is here 60 years after the period it tries to cover, so I'm not sure that ..read more
Visit website
The life of an Ollama prompt
Eli Bendersky's website
by Eli Bendersky
1M ago
In a previous post I've described how - thanks to standardized tooling - we could use a locally-running Gemma model from a Go program within hours from its public release. This post dives into the internals of Ollama - a popular and extremely convenient open-source Go project that makes such workflows possible. HTTP request to Ollama Having installed Ollama and run ollama run gemma, we're ready to send HTTP requests to it. There are several ways to do so: Sending a raw HTTP request with a tool like curl Using Ollama's own client libraries (currently available in Go, Python and JS) Using a pr ..read more
Visit website
Gemma, Ollama and LangChainGo
Eli Bendersky's website
by Eli Bendersky
2M ago
Yesterday Google released Gemma - an open LLM that folks can run locally on their machines (similarly to llama2). I was wondering how easy it would be to run Gemma on my computer, chat with it and interact with it from a Go program. Turns it - thanks to Ollama - it's extremely easy! Gemma was already added to Ollama, so all one has to do is run: $ ollama run gemma And wait for a few minutes while model downloads. From this point on, my previous post about using Ollama locally in Go applies with pretty much no changes. Gemma becomes available through a REST API locally, and can be accessed f ..read more
Visit website
Using Gemini models in Go with LangChainGo
Eli Bendersky's website
by Eli Bendersky
2M ago
In a previous post I've discussed how to access Google's multimodal Gemini models from Go (with a nice free tier!) Recently, Google's SDKs were added as providers for LangChainGo; this makes it possible to use the capabilities of the LangChain framework with Google's Gemini models as LLM providers. This post shows some samples of using these new providers and how simple it is to switch providers from Google AI (which uses API keys) to Vertex (which requires a GCP project). LangChainGo examples with GoogleAI Let's start with the GoogleAI provider. We'll need the latest release of langchaingo. H ..read more
Visit website
Sign in with Google in Go
Eli Bendersky's website
by Eli Bendersky
3M ago
This post provides some code samples for implementing a "Sign-in with Google" flow for your web application in Go. For an overview of auth/authz and the OAuth protocol, please refer to my earlier post about Sign-in with GitHub. Sign-in with Google has existed in one form or another for many years, and the technical approach to it evolved over time. I will start by presenting the currently recommended way - and the one that will feel most familiar to users - and will then mention a slightly more complicated and flexible alternative. Using Google Identity Service (GIS) The currently recommended ..read more
Visit website
Summary of reading: October - December 2023
Eli Bendersky's website
by Eli Bendersky
3M ago
"Nomadland: Surviving America in the Twenty-First Century" by Jessica Bruder - describes the lives of the modern van-dwellers, mostly of older adults that travel around the country between seasonal jobs and live in their RVs or cars. Interesting book that tells a good story and avoids being preachy most of the time. "Oxygen: The molecule that made the world" by Nick Lane - one of Lane's earliest books. Like the others, it's a packed whirlwhind tour of biochemistry, loaded with enough information to cover a couple of graduate courses and enough ideas to kick-start a hundred new research projec ..read more
Visit website
Using Gemini models from Go
Eli Bendersky's website
by Eli Bendersky
4M ago
Google has recently made their newest family of multimodal LLMs available via an API with a generous free tier. Google also released SDKs in several popular programming languages, including Go. This post is a quick overview of how to get started with the Go SDK to ask the model questions that mix text with images. The task We'll be asking the model to explain the difference between two images of turtles; this one: And this one: Using the Google AI SDK With the Google AI SDK, all you need to access the model is generate an API key (similarly to how it works with OpenAI's API). The Go SDK live ..read more
Visit website
Using Ollama with LangChainGo
Eli Bendersky's website
by Eli Bendersky
5M ago
One of the most exciting areas of LLM-related development in 2023 is the availability of powerful (and sometimes even open-source) models we can run locally on our machines. Several tools exist that make it relatively easy to obtain, run and manage such models locally; for example Ollama (written in Go!) LocalAI (also largely in Go!). In this post I'm going to describe how to use Ollama to run a model locally, communicate with it using its API and integrate it into a Go program using LangChainGo. Setting up Ollama To start, follow the installation and setup instructions from the Ollama websit ..read more
Visit website
Retrieval Augmented Generation in Go
Eli Bendersky's website
by Eli Bendersky
5M ago
I've been reading more and more about LLM-based applications recently, itching to build something useful as a learning experience. In this post, I want to share a Retrieval Augmented Generation (RAG) system I've built in 100% Go and some insights I learned along the way. Some limitations of current LLMs Let's take OpenAI's API as an example; for your hard-earned dollars, it gives you access to powerful LLMs and related models. These LLMs have some limitations as a general knowledge system [1]: They have a training cutoff date somewhere in the past; recently, OpenAI moved the cutoff of their G ..read more
Visit website

Follow Eli Bendersky's website on FeedSpot

Continue with Google
Continue with Apple
OR