llamafile-completion-example

command module
v0.0.0-...-3308821 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README ยถ

LlamaFile Completion Example

Welcome to this cheerful example of using LlamaFile for text completion with LangChain Go! ๐ŸŽ‰

What This Example Does

This fun little program demonstrates how to use the LlamaFile model to generate text completions. Here's what it does:

  1. ๐Ÿš€ Sets up a LlamaFile model with custom options:

    • Uses an embedding size of 2048
    • Sets the temperature to 0.8 for more creative outputs
  2. ๐Ÿง  Prepares a simple question: "Brazil is a country? answer yes or no"

  3. ๐Ÿ”ฎ Sends the question to the LlamaFile model for completion

  4. ๐Ÿ“บ Streams the generated response, printing it to the console as it's received

How to Run

  1. Make sure you have Go installed on your system
  2. Clone the repository and navigate to this example's directory
  3. Run the example with go run llamafile_completion_example.go

What to Expect

When you run this example, you'll see the LlamaFile model's response to the question about Brazil streamed to your console. The answer should be a simple "yes" or "no", but remember that with the temperature set to 0.8, there might be some variation or additional context in the response!

Have fun exploring language models with this example! ๐ŸŽˆ๐Ÿค–

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL