{"record":{"id":"e9cb912f6c1afc4d","repo":"BoundaryML/baml","slug":"llm-function-not-found-repl","errorCode":null,"errorMessage":"LLM Function {} not found","messagePattern":"LLM Function (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/cli/repl.rs","lineNumber":547,"sourceCode":"        let run_id = self.current_run_id.unwrap_or(0);\n        let handle_llm_function = move |function_name: String,\n                                        args: Vec<BamlValue>,\n                                        _watch_context: Option<\n            baml_compiler::thir::interpret::WatchStreamContext,\n        >| {\n            let fn_params = fn_params.clone();\n            let runtime_clone = runtime_clone.clone();\n            let env_vars = env_vars.clone();\n            let status_tx = status_tx.clone();\n            async move {\n                match runtime_clone.as_ref() {\n                    Some(runtime) => {\n                        if let Some(tx) = &status_tx {\n                            let _ = tx.send(LlmStatusEvent::Started(run_id, function_name.clone()));\n                        }\n                        let param_names = fn_params\n                            .get(&function_name)\n                            .ok_or_else(|| anyhow!(\"LLM Function {} not found\", function_name))?;\n                        let args = args\n                            .clone()\n                            .into_iter()\n                            .zip(param_names.iter())\n                            .map(|(arg, name)| (name.clone(), arg.clone()))\n                            .collect();\n                        let cxt =\n                            runtime.create_ctx_manager(BamlValue::String(\"none\".to_string()), None);\n                        let status_tx2 = status_tx.clone();\n                        let res = runtime\n                            .call_function(\n                                function_name,\n                                &args,\n                                &cxt,\n                                None,\n                                None,\n                                None,\n                                env_vars,","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/cli/repl.rs#L529-L565","documentation":"When the REPL evaluates a function-call expression, it looks up the function's parameter names in the runtime's function table; if the name is absent the call is rejected with this error. The runtime has no LLM function registered under that identifier.","triggerScenarios":"Evaluating FunctionName(args) at the REPL when fn_params has no entry for that name — i.e. the function is not defined in the loaded BAML sources or was not reloaded after defining it.","commonSituations":"Typos in the function name, calling a function defined in a .baml file that was edited but not :load-reloaded, calling a function from a project whose baml_src was never loaded.","solutions":["Check the exact function name spelling against your .baml files","Run :load <path-to-baml_src> to (re)load sources containing the function","Use :functions (or :help) to list functions the runtime currently knows","Verify the loaded directory is the correct baml_src folder"],"exampleFix":"// before (REPL input)\n:MyFucn(1)\n// after\n:load ./baml_src\nMyFunc(1)","handlingStrategy":"validation","validationCode":"// Before calling, confirm the function exists in loaded sources\n// grep the loaded baml_src: grep -r \"function MyFunc\" baml_src/\n// At the REPL, check available functions first (see :help)","typeGuard":null,"tryCatchPattern":"match result { Err(e) if e.to_string().contains(\"not found\") => eprintln!(\"Load sources first: :load ./baml_src ({e})\"), other => { let _ = other; } }","preventionTips":["Always :load the baml_src directory before calling functions","Copy-paste function names from .baml files instead of typing them","After defining a new function, :load again to refresh the runtime"],"tags":["repl","baml","function-lookup"],"backgroundTag":"entity-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}