contextbudget

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package contextbudget trims oversized input before it reaches the local model, keeping requests inside the model's context window.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTrivial

func IsTrivial(input string) bool

IsTrivial reports whether input is too small/empty to bother offloading.

func Trim

func Trim(input string, maxChars int) (string, bool)

Trim caps input to maxChars. When it must cut, it keeps the head and tail (where summaries/structure usually live) and inserts an elision marker. Both cut points back off to a rune boundary (LO-13: byte-offset cuts split multibyte runes — Spanish á/ñ at a boundary produced mojibake mid-prompt). Returns the possibly-trimmed text and whether trimming occurred.

Types

This section is empty.

Jump to

Keyboard shortcuts

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