contextbudget

package
v0.207.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 2 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.

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