For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help on Discord
HomeGuideExamplesBAML ReferencePlaygroundAgents.mdChangelog
HomeGuideExamplesBAML ReferencePlaygroundAgents.mdChangelog
    • Overview
  • baml-cli
    • init
    • generate
    • test
    • serve
    • dev
    • fmt
  • Language Reference
      • comments
      • Environment Variables
      • string
      • int / float
      • bool
      • array (list)
      • map (dictionary)
      • image / audio
    • Types
    • function
    • test
    • template_string
    • client<llm>
    • class
    • enum
    • generator
  • Generated baml_client
    • with_options(..)
    • AbortSignal / Cancellation
    • Collector
    • logging / env vars
    • AsyncClient / SyncClient
    • TypeBuilder
    • ClientRegistry
    • client Option
    • OnTick
    • Multimodal
    • Image
    • Audio
    • Pdf
    • Video
  • Attributes
    • What are attributes?
    • @alias / @@alias
    • @description / @@description
    • @skip
    • @assert
    • @check
    • Jinja in Attributes
    • @@dynamic
  • LLM Client Providers
    • Overview
    • AWS Bedrock
    • Anthropic
    • Google AI: Gemini
    • Google: Vertex
    • OpenAI
    • OpenAI Responses API
    • OpenAI from Azure
    • OpenRouter
    • openai-generic
    • Microsoft Foundry (openai-generic)
    • Cerebras (openai-generic)
    • Groq (openai-generic)
    • Hugging Face (openai-generic)
    • Keywords AI (openai-generic)
    • Llama API (openai-generic)
    • Litellm (openai-generic)
    • LM Studio (openai-generic)
    • Ollama (openai-generic)
    • Vercel AI Gateway (openai-generic)
    • Tinfoil (openai-generic)
    • TogetherAI (openai-generic)
    • Unify AI (openai-generic)
    • vLLM (openai-generic)
  • LLM Client Strategies
    • Timeout Configuration
    • Retry Policy
    • Fallback
    • Round Robin
  • Prompt Syntax
    • What is jinja?
    • Jinja Filters
    • ctx.output_format
    • ctx.client
    • _.role
    • Variables
    • Conditionals
    • Loops
  • Editor Extension Settings
    • baml.cliPath
    • baml.generateCodeOnSave
    • baml.enablePlaygroundProxy
    • baml.syncExtensionToGeneratorVersion
Help on Discord
LogoLogo
On this page
  • Usage
Language ReferenceGeneral BAML Syntax

int / float

Was this page helpful?
Edit this page
Previous

bool

Next
Built with

Numerical values as denoted more specifically in BAML.

ValueDescription
intInteger
floatFloating point number

We support implicit casting of int -> float, but if you need something to explicitly be a float, use 0.0 instead of 0.

Usage

1function DescribeCircle(radius: int | float, pi: float?) -> string {
2 client "openai/gpt-5-mini"
3 prompt #"
4 Describe a circle with a radius of {{ radius }} units.
5 Include the area of the circle using pi as {{ pi or 3.14159 }}.
6
7 What are some properties of the circle?
8 "#
9}
10
11test CircleDescription {
12 functions [DescribeCircle]
13 // will be cast to int
14 args { radius 5 }
15}
16
17test CircleDescription2 {
18 functions [DescribeCircle]
19 // will be cast to float
20 args {
21 radius 5.0
22 pi 3.14
23 }
24}