N.O.V.A. Chat Agent & Docker Model Runner

NOVA: Neural Optimized Virtual Assistant


I wrote the Go library NOVA for several reasons:



Important note: I work exclusively with Docker Model Runner, but NOVA also works with other AI engines (Ollama, Cerebras, Huggingface, …).



Over the weeks, NOVA has become an SDK of ready-to-use and composable “mini agents”:



There are also these, which are more experimental for now:



Today I’ll be talking about the Chat Agent and how I used it to build a small CLI that I can use anytime to generate content, write code, and also with the code agent Pi Mono, but that will be the subject of another blog post.

Chat Agent

Here’s an example of how to use the Chat Agent:

You’ll need the Lucy model from Menlo for this code, which you can run locally with Docker Model Runner:

docker model pull hf.co/menlo/lucy-gguf:q4_k_m

You can pick a different model if you want (in GGUF format), just make sure to update the modelID in the code.


Initialize your Go project and install the library: ```bash go get github.com/snipwise/nova@latest go mod init chat-demo touch main.go ```

Create a main.go file and paste the following code:

main.go:

package main

import (
	"context"
	"fmt"

	"github.com/snipwise/nova/nova-sdk/agents"
	"github.com/snipwise/nova/nova-sdk/agents/chat"
	"github.com/snipwise/nova/nova-sdk/messages"
	"github.com/snipwise/nova/nova-sdk/messages/roles"
	"github.com/snipwise/nova/nova-sdk/models"
)

func main() {
	ctx := context.Background()

	engineURL := "http://localhost:12434/engines/llama.cpp/v1"
	modelID := "hf.co/menlo/lucy-gguf:q4_k_m"
	temperature := 0.3
	topP := 0.9

	systemInstructions := "Your name is Bob, you are a pizza expert."

	agent, err := chat.NewAgent(
		ctx,
		agents.Config{
			EngineURL:               engineURL,
			SystemInstructions:      systemInstructions,
			KeepConversationHistory: false,
		},
		models.Config{
			Name:        modelID,
			Temperature: models.Float64(temperature),
			TopP:        models.Float64(topP),
		},
	)
	if err != nil {
		fmt.Printf("Error creating agent: %v\n", err)
		return
	}

	_, err = agent.GenerateStreamCompletion(
		[]messages.Message{
			{Role: roles.User, Content: "What is the recipe of the hawaiian pizza?"},
		},
		func(chunk string, finishReason string) error {
			if chunk != "" {
				fmt.Print(chunk)
			}
			return nil
		},
	)
	if err != nil {
		fmt.Printf("Error generating completion: %v\n", err)
		return
	}
}

Now you can run your program:

go mod tidy
go run main.go

You should get a streaming output like this:

Here's a classic **Hawaiian pizza recipe** (based on standard Hawaiian pizza recipes):

---

### **Ingredients**
- **Crust**:
  - 1 1/2 cups all-purpose flour
  - 1 tsp salt
  - 1/2 tsp sugar
  - 1–2 tbsp olive oil (for a garlic butter crust)
  - Warm water (about 100°F)

- **Sauce**:
  - 1–2 tbsp olive oil
  - 1–2 tbsp plain or mayonnaise
  - 1–2 tbsp ketchup
  - 1–2 tbsp pineapple juice
  - 1–2 tbsp lime juice
  - 1 tsp honey or maple syrup
  - 1 tsp garlic (minced)
  - 1/2 tsp cumin
  - Salt and pepper to taste

- **Toppings**:
  - 1–2 slices cooked ham (sliced)
  - 1–2 slices fresh pineapple (sliced or diced)
  - 1/2 cup shredded mozzarella cheese
  - 1/4 cup diced avocado (optional)
  - 1/4 cup diced red onion (optional)

---

### **Steps**
1. **Prepare the Crust**:
   - Mix flour, salt, sugar, and oil. Knead on a floured surface until smooth.
   - Roll out into a thin crust. Add warm water (100°F) and knead until dough is smooth.
   - Refrigerate for 30 minutes (optional).

2. **Make the Sauce**:
   - Heat oil in a pan. Add garlic, cumin, salt, pepper. Cook until fragrant.
   - Add pineapple juice, lime juice, honey, and ketchup. Cook 2–3 minutes.
   - Add mayo and stir. Season with salt and pepper.

3. **Assemble the Pizza**:
   - Preheat oven to 450°F (200°C).
   - Spread sauce on the crust. Add ham, pineapple, mozzarella, and avocado (if using).
   - Top with red onion (optional).

4. **Bake**:
   - Bake for 12–15 minutes, or until golden and bubbly.

---

### **Tips**
- For a garlic butter crust, use a garlic butter recipe (e.g., garlic + butter + flour).
- Add jalapeños or chili for a spicy twist.
- Use a pizza stone or steel for even baking.

Enjoy your Hawaiian pizza! 🍑🍕

See, it’s pretty simple.

Reasoning & Response Streaming

Some LLMs, and that’s precisely the case with Lucy, support “reasoning”, but by default it’s not shown in the response. With NOVA, you can easily enable reasoning streaming, and even differentiate the reasoning stream from the response stream. Replace the initial completion part with this:

_, err = agent.GenerateStreamCompletionWithReasoning(
    []messages.Message{
        {Role: roles.User, Content: "What is the recipe of the hawaiian pizza?"},
    },
    func(reasoningChunk string, finishReason string) error {
        fmt.Print(reasoningChunk)
        if finishReason != "" {
            fmt.Printf("\n[Reasoning finished: %s]\n", finishReason)
            fmt.Println(strings.Repeat("-", 50))
        }
        return nil
    },
    func(responseChunk string, finishReason string) error {
        fmt.Print(responseChunk)
        if finishReason != "" {
            fmt.Printf("\n[Response finished: %s]\n", finishReason)
            fmt.Println(strings.Repeat("=", 50))
            fmt.Println("End of response.")
        }
        return nil
    },
)

And this time you’ll get an output like this, with reasoning and response clearly separated:

Okay, the user is asking about the recipe for Hawaiian pizza. Let me start by recalling what I know about Hawaiian pizza. It's a type of pizza that's popular in Hawaii, right? So the base is usually a thin crust, maybe with a tomato sauce. Then there are the toppings. Common ones are pineapple, ham, cheese, maybe some olives or avocado.

Wait, I should make sure about the specifics. The base is typically a thin crust, like a regular pizza but maybe with a bit more sauce. The sauce is usually a sweet one, maybe with pineapple juice or something. Then the toppings: pineapple is a main component, so that's definitely there. Ham is another staple, so that's included. Cheese, like mozzarella or cheddar, is essential. Sometimes they add things like jalapeños or onions for a spicy kick.

I should also consider the crust type. Some recipes use a garlic butter crust, which is common in Hawaiian pizza. The sauce might be a sweet one, so maybe a pineapple-based sauce. The cheese is usually melted and spread evenly. The toppings are arranged in a way that the pineapple is on the side, and the ham is on the bottom. Sometimes they use a different cheese, like a blend of mozzarella and parmesan.

Wait, are there any variations? For example, some places might use a different type of cheese or add other ingredients like jalapeños. I should mention that it's a bit flexible but the core elements are pineapple, ham, cheese, and a sweet sauce. Also, the crust is thin and crispy, so maybe the crust is baked in a hot oven.

I need to structure the answer clearly. Start with the base, then the sauce, toppings, and the crust. Maybe mention the key ingredients and how they're arranged. Also, note that it's a popular pizza in Hawaii, so it's a local favorite. Make sure to highlight the main components and any common variations.
[Reasoning finished: end_of_reasoning]
--------------------------------------------------
The classic **Hawaiian pizza** is a beloved local favorite, featuring a thin, crispy crust topped with a sweet, pineapple-based sauce, ham, mozzarella cheese, and sometimes jalapeños or onions. Here's a simplified recipe:

---

### **Base & Crust**
- **Crust**: Thin, crispy crust (e.g., garlic butter or regular thin crust).
- **Bake**: Preheat oven to 450°F (230°C).

---

### **Sauce**
- **Sweet sauce**: A pineapple-based sauce (e.g., pineapple juice, ketchup, or a homemade blend).
- **Spread evenly** over the crust.

---

### **Toppings**
1. **Pineapple**: Cut into slices or chunks for a tropical flair.
2. **Ham**: Sliced or diced for layering.
3. **Cheese**: Mozzarella or cheddar, melted and spread evenly.
4. **Optional**: Jalapeños, onions, or a sprinkle of cilantro for extra flavor.

---

### **Assembly**
- Arrange toppings in a layer, ensuring the pineapple is on the side.
- Bake for 10–12 minutes until the crust is golden and the cheese is bubbly.

---

### **Tips**
- **Crust**: Some recipes use a garlic butter crust for extra flavor.
- **Sauce**: A sweet, tangy sauce enhances the pineapple taste.
- **Toppings**: Customize with your favorite ingredients (e.g., avocado, jalapeños, or bacon).

Enjoy your Hawaiian pizza! 🍑🍕
[Response finished: stop]
==================================================
End of response.

If you want more information about the Chat Agent, you can check out its documentation here: Chat Agent Documentation.

The documentation is a 🚧 work in progress.

A sample project using the Chat Agent

I built a small CLI that uses the Chat Agent to generate content from the terminal, which you can find on Codeberg: chat-cli. And I use it like this:

./chat-cli \
    prompt "What is the recipe of the hawaiian pizza?" \
    --instructions context.md \
    --output recipe.md

That’s all for today. In an upcoming blog post, I’ll be talking about the RAG Agent. Don’t go too far! 😉

© 2026 k33g Project | Built with Gu10berg

Subscribe: 📡 RSS | ⚛️ Atom