The Command-Line Function Calling Sample
The function calling sample, nvigi.fcall shows the basics of having an LLM call a function and returning the results of that function for the LLM to then use to answer the user’s query.
NOTE: This sample makes use of a CUDA-based backend, and therefore will not work on non-NVIDIA hardware. This will be fixed in future releases.
These instructions use the following path placeholders, which refer to locations that differ between a binary developer pack and a GitHub source tree:
<SDK_ROOT>: the root of the SDK Plugins tree, which contains thebindirectory for the SDK.<SDK_MODELS>: the root of the models tree for the SDK plugins, normallydata/nvigi.models<SDK_PLATFORM>: the target CPU architecture. See Platform Support for information on supported platforms.
Download Required Models
The function calling sample requires the following models:
Plugin |
Model Name |
GUID |
|---|---|---|
nvigi.plugin.gpt.ggml.* |
Qwen3 8B Instruct |
545F7EC2-4C29-499B-8FC8-61720DF3C626 |
See the top-level documentation that shipped with your development pack for information on how to download these models.
NOTE: This is just a popular model. Other models trained on function calling, such as Qwen3-4B-instruct-2507, may be used. For more details on model repository please read the
ProgrammingGuideAIlocated in the NVIGI Core SDK.
How to Use the Function Calling Sample
When run, the sample should launch a console (or use the one from which it was run); it will await user input. The user may do one of four things, which are also described when the app starts:
Type in “exit” then Enter, which will exit the sample
Type “disable_tools” then Enter. This will not allow any tool usage by the model. It will also reset the internal chat history.
Type “enable_tools” then Enter. This will allow tool usage by the model. It will also reset the internal chat history. This is the default state on start
Type in a Question to the LLM. Depending on the nature of the question, the LLM will have the option of using one of two tools to answer the question. The two tools are either a fake CurrentTempTool or a WikiSearchTool. The CurrentTempTool is hardcoded to return fake temperatures in three cities: Durham, Austin and Santa Clara. CurrentTempTool serves as a basic example of how all the plumbing is hooked up. WikiSearchTool will use libCurl and an internet connection to perform a naive search on wikipedia, find the first search result, and use the extract (first few sentences of the opening summary) to help answer the question. This tool uses a bit more assistance in constructing the tool schema.
Run at Command Line
To run nvigi.fcall from the command line, take the following steps:
Open a command prompt in
<SDK_ROOT>Run the command:
bin\<SDK_PLATFORM>\<Configuration>\nvigi.fcall.exe <SDK_MODELS>
In a standard layout binary development pack or GitHub source tree, launching from a current working directory of the
<SDK_ROOT>directory, this is:
bin\<SDK_PLATFORM>\<Configuration>\nvigi.fcall.exe data/nvigi.models
Building the Sample
The sample is built as part of the SDK build process. For full build instructions, see Building and Debugging. After building, stage the binaries:
copy_sdk_binaries.bat [-x64|-arm64] [Release|Debug|Production]
This ensures all DLLs and the executable are in the same directory (bin\<SDK_PLATFORM>\<Configuration>, where <SDK_PLATFORM> is the target CPU architecture and
Run in Debugger
For the general procedure and background, see the Building and Debugging guide. The settings specific to this sample are:
Property |
Value |
|---|---|
VS Project |
|
Command |
|
Command Arguments |
|
Working Directory |
|