examples/local-llm-example/README.md
Welcome to the Local LLM Example! This nifty little Go program demonstrates how to use a local language model with the langchaingo library. It's perfect for those who want to run AI models on their own machines or servers. Let's dive in!
This example shows you how to:
Here's what's happening in our main function:
We create a new local LLM client using local.New(). This uses default settings from your environment.
We set up a context for our LLM operations.
We generate text by asking the LLM a simple question: "How many sides does a square have?"
Finally, we print the LLM's response!
While the example uses default settings, it also shows you how to customize your LLM:
Just compile and run the Go file, and you'll see the LLM's response to the square question. It's that simple!
This example is a great starting point for experimenting with local LLMs. Feel free to uncomment the additional options and play around with different configurations. Happy coding!