policies

Version

LLM Gateway policies for token usage and model restrictions.

Syntax

policies:
maxInputTokens: <number>
maxOutputTokens: <number>
models: <string>
policies:
  maxInputTokens: <number>
  maxOutputTokens: <number>
  models: <string>

Attributes

NameRequiredDefaultDescriptionExamples
maxInputTokensfalse-Restricts token usage for the input. The size of the input is estimated by gateway based on the request size. Actual token usage may be deviate from this value.-
maxOutputTokensfalse0 (unlimited)Maximum number of tokens the LLM should use to generate a response. This is just a hint that the gateway sends to the LLM provider. The provider may use a different limit.-
modelsfalsenull (no restriction)Desciption: Restricts the models that can be used by the gateway.
-

Can be used in