palantir-cost-tuning
Optimize Palantir Foundry costs through compute tuning, incremental builds, and usage monitoring. Use when analyzing Foundry compute costs, reducing API usage, or implementing cost monitoring for Foundry workloads. Trigger with phrases like "palantir cost", "foundry billing", "reduce foundry costs", "foundry pricing", "foundry expensive".
Best use case
palantir-cost-tuning is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Optimize Palantir Foundry costs through compute tuning, incremental builds, and usage monitoring. Use when analyzing Foundry compute costs, reducing API usage, or implementing cost monitoring for Foundry workloads. Trigger with phrases like "palantir cost", "foundry billing", "reduce foundry costs", "foundry pricing", "foundry expensive".
Teams using palantir-cost-tuning should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/palantir-cost-tuning/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How palantir-cost-tuning Compares
| Feature / Agent | palantir-cost-tuning | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Optimize Palantir Foundry costs through compute tuning, incremental builds, and usage monitoring. Use when analyzing Foundry compute costs, reducing API usage, or implementing cost monitoring for Foundry workloads. Trigger with phrases like "palantir cost", "foundry billing", "reduce foundry costs", "foundry pricing", "foundry expensive".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Palantir Cost Tuning
## Overview
Optimize Foundry compute and API costs through incremental transforms, right-sized Spark profiles, efficient pagination, and usage monitoring.
## Prerequisites
- Active Foundry enrollment with build history
- Access to Foundry resource usage metrics
- Understanding of transform build patterns
## Instructions
### Step 1: Cost Drivers in Foundry
| Cost Category | Driver | Optimization |
|---------------|--------|-------------|
| Compute | Full rebuilds of large transforms | Use `@incremental()` |
| Compute | Oversized Spark profiles | Right-size `@configure` profiles |
| Storage | Redundant dataset snapshots | Configure retention policies |
| API | High-frequency polling | Use webhooks instead |
| API | Small page sizes | Use max page_size (500) |
### Step 2: Convert Full Rebuilds to Incremental
```python
from transforms.api import transform_df, Input, Output, incremental
# BEFORE: Full rebuild every run (expensive for large datasets)
@transform_df(Output("/out"), data=Input("/in"))
def expensive(data):
return data.filter(data.status == "active")
# AFTER: Only processes new/changed rows
@incremental()
@transform_df(Output("/out"), data=Input("/in"))
def cheap(data):
return data.filter(data.status == "active")
```
### Step 3: Right-Size Spark Profiles
```python
from transforms.api import configure
# DON'T: Default profile for everything
# DO: Match profile to actual data size
# Small data (< 1GB) — use lightweight transforms (no Spark)
from transforms.api import transform_polars
@transform_polars(Output("/out"), data=Input("/small_table"))
def small_job(data):
return data.filter(data["status"] == "active")
# Medium data (1-50GB) — default profile is fine
@transform_df(Output("/out"), data=Input("/medium_table"))
def medium_job(data):
return data.select("id", "name")
# Large data (50GB+) — explicit large profile
@configure(profile=["DRIVER_MEMORY_LARGE"])
@transform_df(Output("/out"), data=Input("/big_table"))
def large_job(data):
return data.groupBy("region").count()
```
### Step 4: Replace Polling with Webhooks
```python
# EXPENSIVE: Polling every 30 seconds
import time
while True:
result = client.ontologies.OntologyObject.list(
ontology="co", object_type="Order", page_size=100,
)
process_new_orders(result.data)
time.sleep(30) # 2,880 API calls/day!
# CHEAP: Webhook-driven (0 polling API calls)
# Register webhook for ontology.object.created events
# See palantir-webhooks-events skill
```
### Step 5: Monitor Usage
```python
def log_api_usage(response):
"""Log rate limit headers to track usage patterns."""
remaining = response.headers.get("X-RateLimit-Remaining", "?")
limit = response.headers.get("X-RateLimit-Limit", "?")
print(f"API usage: {remaining}/{limit} remaining")
```
## Output
- Incremental transforms reducing rebuild compute by 90%+
- Right-sized Spark profiles matching actual data volumes
- Webhook-driven architecture eliminating polling costs
- Usage monitoring for ongoing optimization
## Error Handling
| Optimization | Risk | Mitigation |
|-------------|------|------------|
| Incremental | Missed data on schema change | Schedule periodic full rebuild |
| Polars (no Spark) | Data too large for memory | Fall back to Spark for > 1GB |
| Aggressive caching | Stale data | Set TTL matching business requirements |
| Webhook-only | Missed events | Periodic reconciliation job |
## Resources
- [Incremental Transforms](https://www.palantir.com/docs/foundry/transforms-python/transforms-pipelines)
- [Transform Polars](https://www.palantir.com/docs/foundry/transforms-python/lightweight-api-evolution)
- [@configure Profiles](https://www.palantir.com/docs/foundry/api-reference/transforms-python-library/api-configure)
## Next Steps
For reference architecture, see `palantir-reference-architecture`.Related Skills
workhuman-performance-tuning
Workhuman performance tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman performance tuning".
workhuman-cost-tuning
Workhuman cost tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman cost tuning".
wispr-performance-tuning
Wispr Flow performance tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr performance tuning".
wispr-cost-tuning
Wispr Flow cost tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr cost tuning".
windsurf-performance-tuning
Optimize Windsurf IDE performance: indexing speed, Cascade responsiveness, and memory usage. Use when Windsurf is slow, indexing takes too long, Cascade times out, or the IDE uses too much memory. Trigger with phrases like "windsurf slow", "windsurf performance", "optimize windsurf", "windsurf memory", "cascade slow", "indexing slow".
windsurf-cost-tuning
Optimize Windsurf licensing costs through seat management, tier selection, and credit monitoring. Use when analyzing Windsurf billing, reducing per-seat costs, or implementing usage monitoring and budget controls. Trigger with phrases like "windsurf cost", "windsurf billing", "reduce windsurf costs", "windsurf pricing", "windsurf budget".
webflow-performance-tuning
Optimize Webflow API performance with response caching, bulk endpoint batching, CDN-cached live item reads, pagination optimization, and connection pooling. Use when experiencing slow API responses or optimizing request throughput. Trigger with phrases like "webflow performance", "optimize webflow", "webflow latency", "webflow caching", "webflow slow", "webflow batch".
webflow-cost-tuning
Optimize Webflow costs through plan selection, CDN read optimization, bulk endpoint usage, and API usage monitoring with budget alerts. Use when analyzing Webflow billing, reducing API costs, or implementing usage monitoring for Webflow integrations. Trigger with phrases like "webflow cost", "webflow billing", "reduce webflow costs", "webflow pricing", "webflow budget".
vercel-performance-tuning
Optimize Vercel deployment performance with caching, bundle optimization, and cold start reduction. Use when experiencing slow page loads, optimizing Core Web Vitals, or reducing serverless function cold start times. Trigger with phrases like "vercel performance", "optimize vercel", "vercel latency", "vercel caching", "vercel slow", "vercel cold start".
vercel-cost-tuning
Optimize Vercel costs through plan selection, function efficiency, and usage monitoring. Use when analyzing Vercel billing, reducing function execution costs, or implementing spend management and budget alerts. Trigger with phrases like "vercel cost", "vercel billing", "reduce vercel costs", "vercel pricing", "vercel expensive", "vercel budget".
veeva-performance-tuning
Veeva Vault performance tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva performance tuning".
veeva-cost-tuning
Veeva Vault cost tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva cost tuning".