AIP Logic is a Palantir tool that allows you to quickly and maintainably build LLM-driven processes while interacting with your organization's data through the Ontology and computational functionality. AIP Logic is built around the concept of "blocks" of LLM instructions that can be combined linearly to create chain-of-thought workflows that can query data, execute actions and functions, and generate net new information for your use case. AIP Logic measures usage in LLM tokens, LLM block executions, and tool calls. Blocks and tools can also run Ontology queries, actions, and functions, which use their own compute-seconds.
If you have an enterprise contract with Palantir, contact your Palantir representative before proceeding with compute usage calculations.
An AIP Logic resource is comprised of one or more AIP Logic blocks. Running a resource will run the blocks required to achieve a desired output. Blocks can use tools such as Ontology queries, functions, and actions to produce an output.
LLM tokens in AIP are measured in the manner of the underlying model (such as OpenAI ↗), and depend on the size of prompts and responses as well as on the number of prompts that are made. For more information, consult the table of usage for each model type.
On top of LLM token usage, AIP Logic uses a fixed number of compute-seconds for each LLM block execution and each tool call. These charges are additive: an LLM block that calls a tool incurs both.
| Usage | Compute-seconds | When it applies |
|---|---|---|
| LLM block execution | 4 | Each time a Use LLM block runs, with or without tool calls |
| Tool call | 8 | Each time the LLM in a Use LLM block calls a tool, charged on top of the LLM block execution |
The LLM decides at runtime which tools to call and how often, so one block execution can include several tool calls, each charged separately. A Use LLM block inside a loop counts as one LLM block execution per iteration. To see how many tool calls a run makes, test the function and review the Debugger panel.
Use the following formula to calculate these charges:
Copied!1block_and_tool_compute_seconds = (llm_block_executions * 4) + (tool_calls * 8)
When an AIP Logic block federates computation out to external tools (such as Ontology queries or functions), additional compute may be used during the execution of these applications.
Some operations in AIP Logic can significantly affect compute usage. Below, we provide guidance on controlling compute usage by being careful about token usage, the total number of logic block executions, and usage of Foundry compute.
Assume an AIP Logic resource has two Use LLM blocks. The first block does not call any tools. The second block has an action configured with the Apply actions tool, and the LLM calls it once per run. The resource runs end-to-end twice.
Copied!1 2 3 4 5 6 7 8LLM block executions per run: 2 Tool calls per run: 1 Number of runs: 2 1 run = (2 LLM block executions * 4 compute-seconds) + (1 tool call * 8 compute-seconds) 1 run = 8 + 8 = 16 compute-seconds 2 runs = 2 * 16 compute-seconds = 32 compute-seconds
The two runs use 32 compute-seconds for LLM block executions and tool calls. This amount does not include LLM token usage or the compute used by the action itself. For action compute usage, see Ontology Query Compute.
If the LLM called the action twice in each run instead of once, each run would use (2 * 4) + (2 * 8) = 24 compute-seconds, or 48 compute-seconds for both runs.