~kris/9p

llm9p

ref: fa3820070ac0cb7b9932cdd5cbf1137886348f4e llm9p/internal/llmfs/root.go -rw-r--r-- 966 bytes
fa382007 — pdfinn feat(llm): Add extended thinking support and usage tracking 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Package llmfs implements the LLM filesystem exposed via 9P.
package llmfs

import (
	"github.com/NERVsystems/llm9p/internal/llm"
	"github.com/NERVsystems/llm9p/internal/protocol"
)

// NewRoot creates the root directory of the LLM filesystem
func NewRoot(client llm.Backend) protocol.Dir {
	root := protocol.NewStaticDir("llm")

	// Add all files
	root.AddChild(NewAskFile(client))
	root.AddChild(NewModelFile(client))
	root.AddChild(NewTemperatureFile(client))
	root.AddChild(NewSystemFile(client))
	root.AddChild(NewTokensFile(client))
	root.AddChild(NewNewFile(client))
	root.AddChild(NewContextFile(client))
	root.AddChild(NewThinkingFile(client))
	root.AddChild(NewExampleFile())
	root.AddChild(NewUsageFile(client))
	root.AddChild(NewCompactFile(client))

	// Add stream directory
	streamDir := protocol.NewStaticDir("stream")
	streamDir.AddChild(NewStreamAskFile(client))
	streamDir.AddChild(NewChunkFile(client))
	root.AddChild(streamDir)

	return root
}