BoundaryML/baml · error

test profile `{name}` was requested, but {} does not exist

Error message

test profile `{name}` was requested, but {} does not exist

What it means

`baml test --profile <name>` (or a configured default profile) was requested, but there is no baml.toml manifest in the project root, so no profiles can be resolved. `resolve_invocation` looks up the parsed manifest text; when it is None but a profile name was selected, this error fires pointing at the missing `baml.toml` path.

Source

Thrown at baml_language/crates/baml_cli/src/test_command.rs:640

            .transpose()
            .with_context(|| {
                format!(
                    "failed to read test profiles from {}",
                    project_root.join("baml.toml").display()
                )
            })?;

        let selected_name = if self.no_profile {
            None
        } else if let Some(name) = &self.profile {
            Some(name.as_str())
        } else {
            manifest.as_ref().and_then(|m| m.test.default.as_deref())
        };

        let profile_args = if let Some(name) = selected_name {
            let manifest = manifest.as_ref().ok_or_else(|| {
                anyhow!(
                    "test profile `{name}` was requested, but {} does not exist",
                    project_root.join("baml.toml").display()
                )
            })?;
            let profile = manifest.test.profiles.get(name).ok_or_else(|| {
                let available = if manifest.test.profiles.is_empty() {
                    "none configured".to_string()
                } else {
                    manifest
                        .test
                        .profiles
                        .keys()
                        .map(String::as_str)
                        .collect::<Vec<_>>()
                        .join(", ")
                };
                anyhow!(
                    "test profile `{name}` is not defined in {} (available: {available})",

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Create a `baml.toml` in the project root and define the profile under `[test.profiles.<name>]`.
  2. Run from (or point `--from` at) the directory containing the project's baml.toml.
  3. Commit baml.toml to the repo so CI has it.
  4. Drop `--profile` (or use `--no-profile`) if you don't need profile-specific args.

Example fix

// before
baml test --profile ci   # no baml.toml
// after (baml.toml)
[test.profiles.ci]
args = ["--include", "critical::*"]
// then
baml test --profile ci
Defensive patterns

Strategy: validation

Validate before calling

// shell: ensure manifest exists and profile is defined before invoking
[ -f baml.toml ] || { echo "baml.toml missing in $(pwd)"; exit 1; }
grep -q "[test.profiles.$PROFILE]" baml.toml || { echo "profile $PROFILE undefined"; exit 1; }

Try / catch

if ! baml test --profile "$P" 2>err.log; then
  grep -q 'does not exist' err.log && { echo "create baml.toml or check --from path"; }
  cat err.log; exit 1
fi

Prevention

When it happens

Trigger: Running `baml test --profile <name>` (or `test.default` set elsewhere without a manifest) from a project root where `baml.toml` does not exist — `manifest` is `None` because no manifest text was loaded.

Common situations: Running `baml test` in a directory without baml.toml (or before initializing the project); a typo'd `--from` path pointing outside the project; CI configured to pass `--profile` but the manifest file isn't committed; the file was deleted or renamed (e.g. baml.yaml).

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/eff7d1693fe86dea. Report an issue: GitHub.