# Anthropic SDKs and Claude Code Source: https://docs.getimpala.ai/anthropic-sdk Impala serves the Anthropic Messages API. Point the Anthropic SDKs, the Claude Agent SDK, or Claude Code at your endpoint. Impala serves **`/v1/messages`** alongside its OpenAI-compatible endpoints, so Anthropic-format tooling talks to it directly. That covers the Anthropic SDKs, the **Claude Agent SDK**, and **Claude Code**. ## What you need * `BASE_URL` — your Impala endpoint * `API_KEY` — your Impala key * `MODEL` — the model your endpoint serves Either `Authorization: Bearer` or `x-api-key` is accepted, so the SDKs work with their own defaults. > [!NOTE] > > The Anthropic SDKs append `/v1/messages` to whatever base URL you give them. Pass the host root, > not a URL that already ends in `/v1`. ## Anthropic SDK ```python theme={null} import anthropic client = anthropic.Anthropic( base_url="", api_key="", ) message = client.messages.create( model="", max_tokens=256, messages=[{"role": "user", "content": "Summarize this ticket in one line."}], ) print(message.content[0].text) ``` TypeScript is the same shape: ```javascript theme={null} import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: process.env.BASE_URL, apiKey: process.env.API_KEY, }); const message = await client.messages.create({ model: process.env.MODEL, max_tokens: 256, messages: [{ role: "user", content: "Summarize this ticket in one line." }], }); ``` Or directly: ```bash theme={null} curl -X POST "$BASE_URL/v1/messages" \ -H "content-type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -d '{ "model": "'"$MODEL"'", "max_tokens": 256, "messages": [{"role": "user", "content": "Hello"}] }' ``` ## Claude Agent SDK and Claude Code Both read the standard Anthropic environment variables, so neither needs a code change: ```bash theme={null} export ANTHROPIC_BASE_URL="" export ANTHROPIC_AUTH_TOKEN="" export ANTHROPIC_MODEL="" ``` Then run your agent, or launch `claude`, from that same shell. Set `ANTHROPIC_MODEL` explicitly. Clients that discover available models at startup expect Anthropic's own catalog, and naming the model yourself avoids that lookup. ## Things to know **Raise your timeouts.** A call takes seconds and can take longer under load, and an agent making many sequential turns multiplies that. Raise the timeout in whatever runs your agent and keep turn counts low — see [Run async and open source](/async-inference). **This path is per-request.** That suits an agent loop, where each turn depends on the last. Where the work is a rollout over a fixed input set, that part is cheaper as a [batch](/run-your-first-batch). Nothing here requires a proxy. If you want one for provider routing, key isolation, or central budget controls, see [LiteLLM](/connect-litellm). ## Need help? Reach out to your Impala contact directly. # Cancel Batch Source: https://docs.getimpala.ai/api-reference/batches/cancel-batch /openai-api-swagger.json post /v1/batches/{batch_id}/cancel Cancel a batch. # Create Batch Source: https://docs.getimpala.ai/api-reference/batches/create-batch /openai-api-swagger.json post /v1/batches Create a new batch of API requests. # Get Batch Source: https://docs.getimpala.ai/api-reference/batches/get-batch /openai-api-swagger.json get /v1/batches/{batch_id} Retrieve a specific batch. # List Batches Source: https://docs.getimpala.ai/api-reference/batches/list-batches /openai-api-swagger.json get /v1/batches List all batches. # Delete File Source: https://docs.getimpala.ai/api-reference/files/delete-file /openai-api-swagger.json delete /v1/files/{file_id} Delete a specific file. # Get File Source: https://docs.getimpala.ai/api-reference/files/get-file /openai-api-swagger.json get /v1/files/{file_id} Retrieve metadata for a specific file. # Get File Content Source: https://docs.getimpala.ai/api-reference/files/get-file-content /openai-api-swagger.json get /v1/files/{file_id}/content Retrieve the content of a specific file. # List Files Source: https://docs.getimpala.ai/api-reference/files/list-files /openai-api-swagger.json get /v1/files List all uploaded files. # Upload File Source: https://docs.getimpala.ai/api-reference/files/upload-file /openai-api-swagger.json post /v1/files Upload a file using true streaming without buffering to disk. # Health Source: https://docs.getimpala.ai/api-reference/system/health /openai-api-swagger.json get /health Liveness probe - returns 200 if server is running. # Ready Source: https://docs.getimpala.ai/api-reference/system/ready /openai-api-swagger.json get /ready Readiness probe - returns 200 if services are initialized and ready. # Run async and open source Source: https://docs.getimpala.ai/async-inference Cheaper inference, better quality. The best open-source models cost far less to run when your workload can tolerate latency. Open-weight models are at the frontier, so **spending less no longer means running something weaker**. What costs money is the volume of tokens you push through them — and most of that volume runs with nobody watching: coding agents grinding through a repo overnight, research agents that take four minutes to come back with an answer, nightly jobs classifying a few million records. The deadline applies to the finished task, so paying interactive prices for a fast first token buys you nothing. That is the traffic Impala is built for: **async inference**, meaning model calls where no human reads the tokens as they arrive. Latency you aren't using is the one thing you can trade for a much lower price on the same model — cheap enough that you stop rationing turns and context. | | Interactive | Async | | - | - | - | | Immediate response | Expected, token by token | Not required | | Measured by | TTFT, TPOT, ITL | Tasks per dollar, task completion time | | Capacity is | Held ready | Kept busy | ## The metric is tasks per dollar For async work the question is: for a fixed budget, how many tasks finish? That's **tasks per dollar** — the cost of one completed task. Two numbers feed it: **throughput**, how many tokens the fleet produces, and **task completion time**, how long one task takes end to end. Throughput and task completion time aren't a trade against each other: **faster and cheaper, not faster or cheaper**. A single request may sit longer here than at an interactive provider, while the task it belongs to finishes sooner and costs less — because the scheduler works the whole trace rather than each call in isolation. A GPU costs the same per hour saturated or idle, so cost per token is a throughput problem: double throughput on the same hardware and cost falls by roughly half. The argument with the numbers is in [Run It Hot](https://www.getimpala.ai/blog/run-it-hot); the engine that delivers it is [Impala Herd](/impala-herd). ![The Usage view on the Impala platform, showing throughput in requests per minute and latency at p50, p90 and p95 measured in seconds](https://mintcdn.com/impalaai/D6PXSk0MrZyYwOiY/platform-usage.png?fit=max\&auto=format\&n=D6PXSk0MrZyYwOiY\&q=85\&s=afc5606067de03768ac144b256e3e997) # Raise AWS service quotas Source: https://docs.getimpala.ai/aws_service_quotas_for_Impala_data_plane_deployment Review and raise the AWS service quotas required before deploying the Impala data plane with ./deploy.sh. Review and, where needed, request increases for the quotas below **before** running `./deploy.sh`. > [!WARNING] > > Quota increases that require AWS review can take 24–72 hours — request them in advance. All quotas are per-region unless noted. Find them in the [AWS Service Quotas console](https://console.aws.amazon.com/servicequotas/home). ## Summary table | Service | Quota name | Quota code | Default | Recommended target | Action required? | | - | - | - | - | - | - | | EC2 | Running On-Demand Standard (A,C,D,H,I,M,R,T,Z) instances (vCPUs) | L-1216C47A | 32 | **256** | **Yes — raise before deploy** | | EC2 | All G and VT Spot Instance Requests (vCPUs) | L-3819A6DF | 0–32 | **128** | **Yes — often 0 by default** | | EC2 | All P Spot Instance Requests (vCPUs) | L-7212CCBC | 0 | **384** | **Yes — always 0 by default** | | IAM | Managed policies attached to a role | L-0DA4ABF3 | 10 | **25** | **Yes — raise before deploy** | | VPC | VPCs per region | L-F678F1CE | 5 | **10** | Yes — raise proactively | | VPC | NAT gateways per Availability Zone | L-FE5A380F | 5 per AZ | **10** | Yes — raise proactively | | EC2 | Elastic IP addresses | L-0263D0A3 | 5 | **20** | Yes — raise proactively | | VPC | Interface endpoints per VPC | (see VPC service quotas) | 50 | **100** | Yes if using existing VPC | | S3 | Buckets | L-DC2B2D3D | 100 | **150** | Yes — raise proactively | | EC2 | Application Load Balancers | L-53DA6B97 | 20 | **50** | Yes — raise proactively | | EC2 | Network Load Balancers | L-69A177A2 | 20 | **50** | Yes — raise proactively | | EKS | Clusters per region | L-1194D53C | 100 | 100 | No | | IAM | Roles per account | L-FE177D64 | 1000 | 1000 | No | | IAM | Customer managed policies per account | L-E95E4862 | 1500 | 1500 | No | ## Detailed breakdown ### 1. EC2 On-Demand vCPUs (Standard instances) — raise this first Quota code: **L-1216C47A** · Default: 32 vCPUs The Terraform deployment creates two managed node groups, and Karpenter then launches additional CPU nodes from the `m`-family (gen 5+, 2+ vCPUs) to run Impala services. **Initial managed node groups (created by `./deploy.sh`):** | Node group | Instance type | vCPUs | Min → Desired → Max | | - | - | - | - | | CPU nodes | `m6a.4xlarge` | 16 | 0 → 1 → 2 | | Karpenter bootstrap | `c6a.large` / `m6a.large` / `c5a.large` / `r6a.large` | 2 | 0 → 1 → 2 | **Minimum at deploy time:** 18 vCPUs (1 × m6a.4xlarge + 1 Karpenter bootstrap node). After `./deploy.sh` completes, Karpenter launches additional `m`-family nodes to schedule Impala services (mongodb, rabbitmq, prometheus, openai-api, planner, deployer, scaler, etc.). These workloads collectively require several nodes; the On-Demand quota must cover the full steady-state fleet. **Recommended target: 256 vCPUs** — covers a full Impala service fleet plus headroom for Karpenter burst scaling without requiring another quota request mid-operation. All instance types above are "Standard" family and count against the same quota. GPU nodes use separate Spot quotas — see sections 2 and 3. ### 2. GPU Spot instances — G family (`g6e`) — likely 0 by default Quota code: **L-3819A6DF** (`All G and VT Spot Instance Requests`) · Default: 0–32 vCPUs (varies by region; often 0) Karpenter's GPU node pool uses `g6e.xlarge` or `g6e.2xlarge` Spot instances for inference workloads: | Instance type | vCPUs | GPU | GPU memory | Spot vCPUs consumed | | - | - | - | - | - | | `g6e.xlarge` | 4 | 1× NVIDIA L40S | 48 GB | 4 | | `g6e.2xlarge` | 8 | 1× NVIDIA L40S | 48 GB | 8 | Karpenter selects the cheapest available type. To run a single GPU node you need at least **8 vCPUs** in this quota (to allow either size to be selected). **Recommended target: 128 vCPUs** — enough for up to 16× g6e.xlarge or 16× g6e.2xlarge concurrently, giving Karpenter room to scale inference workloads without stalling on quota. Check your current quota: ```bash theme={null} aws service-quotas get-service-quota \ --service-code ec2 \ --quota-code L-3819A6DF \ --region us-east-1 \ --query 'Quota.Value' ``` > [!NOTE] > > `g6e` instances are not available in all regions. Before requesting the quota, verify availability: > > ```bash theme={null} > aws ec2 describe-instance-type-offerings \ > --filters Name=instance-type,Values=g6e.xlarge \ > --query 'InstanceTypeOfferings[].Location' --output text > ``` ### 3. GPU Spot instances — P family (`p5`, `p5en`) — always 0 by default Quota code: **L-7212CCBC** (`All P Spot Instance Requests`) · Default: 0 vCPUs The GPU node pool also lists `p5.48xlarge` and `p5en.48xlarge` for high-end workloads. These have a default Spot quota of **0** and require a manual AWS review to increase. | Instance type | vCPUs | GPUs | GPU memory | Notes | | - | - | - | - | - | | `p5.48xlarge` | 192 | 8× NVIDIA H100 SXM5 | 640 GB | Requires dedicated capacity | | `p5en.48xlarge` | 192 | 8× NVIDIA H100 | 640 GB | Requires dedicated capacity | **Recommended target: 384 vCPUs** (2× p5.48xlarge concurrently). **To use p5/p5en Spot instances:** 1. Open a Service Quota increase request for `L-7212CCBC`. 2. Include a brief justification (ML inference workloads). 3. AWS typically responds within 1–5 business days; capacity is regionally limited. If p5/p5en Spot capacity is unavailable in your region, Karpenter will fall back to `g6e` instances automatically. If neither GPU family is available or quota is insufficient, GPU workloads will remain pending. ### 4. VPC interface endpoints per VPC Quota name: **Interface endpoints per VPC** (search under the "Amazon VPC" service in the Service Quotas console) · Default: 50 The networking stack creates **13 interface endpoints** by default, plus 1 more when Impala Connect is enabled (`enable_impala_connect = true`, which is the default): | Endpoint | AWS service | | - | - | | `ecr.dkr` | Container image pulls | | `ecr.api` | ECR management | | `sts` | IAM token exchange | | `eks` | EKS API plane | | `eks-auth` | EKS Pod Identity | | `ec2` | EC2 API (Karpenter, node groups) | | `sqs` | Karpenter interrupt queue | | `ssm` | Systems Manager on nodes | | `kms` | Encryption at rest | | `elasticloadbalancing` | ALB/NLB provisioning | | `xray` | Distributed tracing | | `logs` | CloudWatch Logs | | `route53` | Private DNS (cross-region, us-east-1) | | `impala_connect` | Impala Connect PrivateLink (default on) | **Total: 14 interface endpoints** with defaults. Each entry in `s3_cross_region_access_regions` adds one more S3 interface endpoint per configured region. This is well within the default quota of 50 for a fresh VPC. However, if you set `existing_vpc_id` to reuse an existing VPC that already hosts many endpoints, check your current count before deploying: ```bash theme={null} aws ec2 describe-vpc-endpoints \ --filters Name=vpc-id,Values= Name=vpc-endpoint-type,Values=Interface \ --query 'length(VpcEndpoints)' --output text ``` **Recommended target: 100** — request this when creating a new VPC too, so future endpoint additions never require a second quota request. ### 5. VPCs per region Quota code: **L-F678F1CE** · Default: 5 `./deploy.sh` creates **1 new VPC** (CIDR `10.0.0.0/16` by default) unless you set `existing_vpc_id` to reuse an existing one. Check your current count: ```bash theme={null} aws ec2 describe-vpcs --query 'length(Vpcs)' --output text ``` **Recommended target: 10** — request this proactively regardless of current count. ### 6. NAT gateways per Availability Zone Quota code: **L-FE5A380F** · Default: 5 per AZ The default deployment creates **1 NAT gateway** (single-AZ, cost-optimized). One Elastic IP is consumed per NAT gateway. Check your current count per AZ: ```bash theme={null} aws ec2 describe-nat-gateways \ --filter Name=state,Values=available \ --query 'NatGateways[].SubnetId' --output text ``` **Recommended target: 10 per AZ** — request this proactively. If you later switch to `single_nat_gateway = false` for HA, you need 3 NAT gateways across 3 AZs and no room for error at the default limit of 5. ### 7. Elastic IP addresses Quota code: **L-0263D0A3** · Default: 5 The deployment allocates **1 Elastic IP** for the NAT gateway (more if you set `single_nat_gateway = false`, one per AZ). Check your current allocation: ```bash theme={null} aws ec2 describe-addresses --query 'length(Addresses)' --output text ``` **Recommended target: 20** — request this proactively. HA NAT (3 AZs) consumes 3 EIPs; other AWS resources in the account share this pool. ### 8. S3 buckets Quota code: **L-DC2B2D3D** · Default: 100 per account (account-wide, not per region) The Terraform storage stack creates 2 buckets. The Helm charts reference up to 2 additional customer-managed buckets (models storage and a dedicated batches bucket), for a total of **2–4 new buckets**: | Bucket | Created by | Purpose | | - | - | - | | Resources bucket | Terraform (`storage` stack) | Batch metadata, logs, metrics | | Batches bucket | Terraform (`storage` stack) | Customer batch files | | Models bucket | Customer-provided (optional) | Tokenizer / model weights (read-only) | | Additional batches bucket | Customer-provided (optional) | Separate batches storage | Check your current count: ```bash theme={null} aws s3api list-buckets --query 'length(Buckets)' --output text ``` **Recommended target: 150** — request this proactively. The default 100 is account-wide and fills up faster than expected across environments. ### 9. EBS volumes — persistent storage from Helm workloads EBS volumes are provisioned automatically by the EBS CSI driver when Helm charts are deployed. The following PersistentVolumeClaims are created by default (all `gp3`, encrypted): | Workload | Volume size | Note | | - | - | - | | MongoDB | 20 Gi | Database data directory | | Prometheus | 50 Gi × 2 replicas | Metrics retention (15 days / 40 GB) | | RabbitMQ | 20 Gi | Message queue persistence | | Data-sync client | 1 Gi | State tracking | | Alertmanager | 10 Gi | Disabled by default; enabled if alerts are configured | **Minimum persistent storage at chart deploy time: \~141 GiB across 5 volumes.** Additionally, every Karpenter-provisioned node consumes an EBS root/data volume: * CPU nodes (Karpenter-managed): 30 Gi gp3 root volume per node * GPU nodes (`g6e`/`p5`): 4 Gi root (Bottlerocket OS) + 50 Gi data volume per node EBS volume count and total storage are unlikely to hit AWS quota limits (defaults are in the thousands of TiB), but gp3 IOPS and throughput reserved by the Prometheus and MongoDB volumes may matter on small instance types — both workloads benefit from their persistent volumes being on the same node as the pod (VolumeBindingMode: `WaitForFirstConsumer`). ### 10. Load balancers (ALB + NLB) ALB quota code: **L-53DA6B97** · NLB quota code: **L-69A177A2** · Default: 20 each **Created by Terraform (`./deploy.sh`):** * 1 NLB — PrivateLink endpoint service (`enable_eks_api_privatelink = true` by default) **Created by Helm charts (via AWS Load Balancer Controller):** * 1 ALB — `impala-services` ingress (routes `deployer`, `scaler`, `hardware-estimator`) * 0–3 optional internal NLBs — one each for `deployer`, `mongodb`, and `prometheus` when `internalNLB.enabled: true` is set in their chart values (used for cross-region / satellite cluster connectivity) **Maximum total: 1 ALB + 4 NLBs.** The default limit of 20 feels comfortable, but the AWS Load Balancer Controller can create additional load balancers for other Kubernetes services over time. **Recommended target: 50 for both ALB and NLB** — request both proactively. Check current usage first: ```bash theme={null} aws elbv2 describe-load-balancers --query 'LoadBalancers[].Type' --output text | tr '\t' '\n' | sort | uniq -c ``` ### 11. EKS clusters Quota code: **L-1194D53C** · Default: 100 The deployment creates **1 EKS cluster**. The default limit is very unlikely to be an issue. ### 12. IAM — roles, policies, and attachments per role #### 12a. IAM roles Quota code: **L-FE177D64** · Default: 1000 per account The deployment creates **12 IAM roles** in total (all features enabled): | Role | Stack | Conditional on | | - | - | - | | `eks_cluster` | iam-base | Always | | `eks_nodes` | iam-base | Always | | `impala_access_role` | iam-base | Always | | `workload_role` | iam-oidc | OIDC provider available | | `karpenter` | iam-oidc | `enable_karpenter = true` + OIDC | | `vpc_cni_role` | iam-oidc | OIDC provider available | | `aws_load_balancer_controller` | iam-oidc | OIDC provider available | | `scaler` | iam-oidc | `enable_scaler = true` + OIDC | | `external_dns` | iam-oidc | OIDC provider available | | `ebs_csi` | eks-csi-roles | OIDC provider available | | `s3_csi` | eks-csi-roles | OIDC provider available | | `eni_reconcile` (Lambda) | privatelink | `enable_eks_api_privatelink = true` | Rarely a problem, but check if your account is near the limit: ```bash theme={null} aws iam list-roles --query 'length(Roles)' --output text ``` #### 12b. Customer managed policies Quota code: **L-E95E4862** · Default: 1500 per account The deployment creates **15 customer managed policies** (all features enabled): | Policy | Stack | Conditional on | | - | - | - | | `ecr_read_access_policy` | iam-base | Always | | `service_quotas_readonly_policy` | iam-base | Always | | `models_s3_readonly_access_policy` | iam-base | Always | | `ec2_cluster_access_policy` | iam-base | Always | | `resources_s3_full_access_policy` | iam-base | `s3_resources_bucket_arn` provided | | `batches_s3_full_access_policy` | iam-base | `s3_batches_bucket_arn` provided | | `batches_s3_list_access_policy` | iam-base | `s3_batches_bucket_arn` provided | | `eks_admin_access_policy` | iam-base | `cluster_arn` provided | | `karpenter_cluster_access_policy` | iam-base | `enable_karpenter = true` + cluster\_arn | | `ec2_read_access_policy` | iam-oidc | OIDC provider available | | `aws_load_balancer_controller_policy` | iam-oidc | OIDC provider available | | `sqs_node_metrics_access_policy` | iam-oidc | `enable_node_monitoring = true` | | `sqs_node_lifecycle_access_policy` | iam-oidc | `enable_node_monitoring = true` | | `sqs_launch_failure_access_policy` | iam-oidc | `enable_node_monitoring = true` | | `scaler_eks_access_policy` | iam-oidc | `enable_scaler = true` | Check current count: ```bash theme={null} aws iam list-policies --scope Local --query 'length(Policies)' --output text ``` #### 12c. Managed policies attached to a role — raise this before deploy > [!WARNING] > > This is the most likely IAM quota to be hit. The deployment will fail at the `iam-base` apply step unless this quota is raised first. Quota code: **L-0DA4ABF3** · Default: **10 per role** The `eks_nodes` role receives **11 managed policy attachments** when all default features are enabled: | # | Policy | Type | | - | - | - | | 1 | `AmazonEKSWorkerNodePolicy` | AWS managed | | 2 | `AmazonEKS_CNI_Policy` | AWS managed | | 3 | `AmazonEBSCSIDriverPolicy` | AWS managed | | 4 | `AmazonSSMManagedInstanceCore` | AWS managed | | 5 | `AmazonEC2ContainerRegistryReadOnly` | AWS managed | | 6 | `ecr_read_access_policy` | Customer managed | | 7 | `ec2_cluster_access_policy` | Customer managed | | 8 | `models_s3_readonly_access_policy` | Customer managed | | 9 | `resources_s3_full_access_policy` | Customer managed (conditional) | | 10 | `batches_s3_full_access_policy` | Customer managed (conditional) | | 11 | `karpenter_cluster_access_policy` | Customer managed (conditional) | With the default configuration (`enable_karpenter = true`, S3 buckets provided), `eks_nodes` sits at 11 — one over the default limit of 10. **The deployment will fail at the `iam-base` apply step** unless this quota is raised first. **Recommended target: 25** — gives room for the current 11 attachments plus future policy additions without needing another quota request. **Request the increase:** ```bash theme={null} aws service-quotas request-service-quota-increase \ --service-code iam \ --quota-code L-0DA4ABF3 \ --desired-value 25 \ --region us-east-1 ``` > [!NOTE] > > IAM is a global service. The quota is account-wide, not per-region — request it once in `us-east-1` regardless of your deployment region. ## Checking and requesting increases 1. Open the [AWS Service Quotas console](https://console.aws.amazon.com/servicequotas/home) in the target region. 2. Search for the quota by name or code. 3. Select **Request quota increase** and enter the desired value. 4. On-Demand EC2 vCPU increases are usually auto-approved within a few hours. Spot GPU quotas (especially P family) require manual AWS review — **submit these first, they take the longest**. Request via CLI (replace `` with your deployment region): ```bash theme={null} # IAM: managed policies per role (global — request once in us-east-1) aws service-quotas request-service-quota-increase \ --service-code iam --quota-code L-0DA4ABF3 \ --desired-value 25 --region us-east-1 # On-Demand Standard vCPUs aws service-quotas request-service-quota-increase \ --service-code ec2 --quota-code L-1216C47A \ --desired-value 256 --region # G/VT Spot vCPUs (g6e inference nodes) aws service-quotas request-service-quota-increase \ --service-code ec2 --quota-code L-3819A6DF \ --desired-value 128 --region # P Spot vCPUs (p5/p5en nodes) aws service-quotas request-service-quota-increase \ --service-code ec2 --quota-code L-7212CCBC \ --desired-value 384 --region # VPCs per region aws service-quotas request-service-quota-increase \ --service-code vpc --quota-code L-F678F1CE \ --desired-value 10 --region # NAT gateways per AZ aws service-quotas request-service-quota-increase \ --service-code vpc --quota-code L-FE5A380F \ --desired-value 10 --region # Elastic IP addresses aws service-quotas request-service-quota-increase \ --service-code ec2 --quota-code L-0263D0A3 \ --desired-value 20 --region # Application Load Balancers aws service-quotas request-service-quota-increase \ --service-code elasticloadbalancing --quota-code L-53DA6B97 \ --desired-value 50 --region # Network Load Balancers aws service-quotas request-service-quota-increase \ --service-code elasticloadbalancing --quota-code L-69A177A2 \ --desired-value 50 --region # S3 buckets (account-wide — request once in us-east-1) aws service-quotas request-service-quota-increase \ --service-code s3 --quota-code L-DC2B2D3D \ --desired-value 150 --region us-east-1 ``` ## Notes on configuration variants | Deployment option | Additional quota impact | | - | - | | `single_nat_gateway = false` (HA NAT) | 1 NAT gateway + 1 EIP **per AZ** (typically ×3) | | `enable_eks_api_privatelink = false` | Saves 1 NLB | | `enable_openai_api_privatelink = true` | +1 NLB, +1 VPC endpoint service | | `existing_vpc_id = ...` (bring your own VPC) | No new VPC or NAT gateway consumed | | `internalNLB.enabled: true` (per-chart) | +1 NLB per enabled service (deployer, mongodb, prometheus) | | GPU nodes disabled (Karpenter GPU pool removed) | No G/VT or P Spot quota needed | | Alertmanager enabled | +1 EBS volume (10 Gi gp3) | | Prometheus replicas > 2 | +1 × 50 Gi EBS per additional replica | ## Need help? Reach out to your Impala contact directly. # Billing API Source: https://docs.getimpala.ai/billing-api Pull your usage, spend and prices programmatically, with the same API key you use for inference. The Billing API returns your team's usage and spend as JSON, so you can track costs, charge usage back to internal teams, or feed your own dashboards. It's read-only and scoped to the team that owns the calling key: any key on your team reads all of the team's figures. Spend figures update within about a minute of a request. | Method | Path | Returns | | - | - | - | | `GET` | `/v1/account` | Team, plan and the calling key; on pay-as-you-go, also the wallet | | `GET` | `/v1/account/keys` | Your team's API keys, metadata only | | `GET` | `/v1/account/spend` | Spend, requests and tokens in daily buckets | | `GET` | `/v1/account/prices` | Your per-token price list (pay-as-you-go only) | Base URL: `https://api.platform.getimpala.ai` ## Authentication Send the API key you already use for inference as a bearer token. No separate key is needed. ```bash theme={null} -H "Authorization: Bearer $IMPALA_API_KEY" ``` A blocked or expired key gets a `401`. Billing reads keep working when your wallet is empty and inference requests are refused. ## Plan differences On pay-as-you-go, `/v1/account` includes `wallet`, and `/v1/account/prices` returns your price list. On other plans, `wallet` is left out of the response (the field is absent, not `null`) and `/v1/account/prices` returns `404`. `/v1/account/spend` reports `spend_usd` on pay-as-you-go and committed-usage plans; on contract plans it's `null`. `/v1/account/keys` works the same on every plan. ## Endpoints > [!NOTE] > > Values in the response examples are illustrative. ### Get account `GET /v1/account` Returns your team, billing plan and the key that made the call. On pay-as-you-go, it also returns `wallet`. ```bash theme={null} curl https://api.platform.getimpala.ai/v1/account \ -H "Authorization: Bearer $IMPALA_API_KEY" ``` ```json theme={null} { "customer_id": "acme-research", "team_alias": "acme-research", "billing_plan": "pay_as_you_go", "key": { "id": "7faeb355f584484a0e051892a69b58290ac927f8d0b858539564ae196ff9f2e0", "alias": "prod-batch", "masked": "sk-...4f2a", "spend_usd": 412.37, "max_budget_usd": 500.0, "budget_remaining_usd": 87.63, "blocked": false, "created_at": "2026-08-02T09:14:00.212000+00:00", "is_caller": true }, "wallet": { "currency": "usd", "balance_cents": 67945, "funded_cents": 250000, "deposited_cents": 250000, "adjustments_cents": 0, "spent_cents": 182055, "overdraft_cents": 0, "floor_cents": 0, "blocked": false, "spend_as_of": 1791727200 } } ``` **customer\_id** `string | null` Your customer ID. **team\_alias** `string | null` Your team's name. **billing\_plan** `string | null` `pay_as_you_go`, `contract` or `committed_usage`. `null` if your team has no plan on record. **key** `object` The calling key, with the same fields as an entry in [`/v1/account/keys`](#list-keys). **wallet** `object` Pay-as-you-go only. Your prepaid wallet, in integer US cents. **properties** **currency** `string` Always `usd`. **balance\_cents** `integer` `funded_cents` minus `spent_cents`. Can be negative. **funded\_cents** `integer` `deposited_cents` plus `adjustments_cents`. **deposited\_cents** `integer` Top-ups and credit grants. **adjustments\_cents** `integer` Refunds and corrections, either sign. **spent\_cents** `integer` Usage charged to the wallet since you enrolled. Lags the last request by about a minute. **overdraft\_cents** `integer` How far below zero the balance may go. **floor\_cents** `integer` Minus `overdraft_cents`. Inference requests are refused once `balance_cents` drops below it. **blocked** `boolean` `true` while nothing has been funded (`funded_cents` is `0` or less). A funded wallet that runs past the floor still reads `false`, so compare `balance_cents` with `floor_cents` to tell whether requests are being refused. **spend\_as\_of** `integer` When `spent_cents` was read, as Unix seconds. ### List keys `GET /v1/account/keys` Returns your team's API keys. Only metadata is returned, never the key itself. ```bash theme={null} curl https://api.platform.getimpala.ai/v1/account/keys \ -H "Authorization: Bearer $IMPALA_API_KEY" ``` ```json theme={null} { "keys": [ { "id": "7faeb355f584484a0e051892a69b58290ac927f8d0b858539564ae196ff9f2e0", "alias": "prod-batch", "masked": "sk-...4f2a", "spend_usd": 412.37, "max_budget_usd": 500.0, "budget_remaining_usd": 87.63, "blocked": false, "created_at": "2026-08-02T09:14:00.212000+00:00", "is_caller": true }, { "id": "9977ac6a31d4bbd6981498c00796240500012473ae7299425ec69d0b05a43698", "alias": "staging", "masked": "sk-...91bc", "spend_usd": 38.05, "max_budget_usd": null, "budget_remaining_usd": null, "blocked": false, "created_at": "2026-09-14T16:02:41.508000+00:00", "is_caller": false } ], "count": 2 } ``` **keys** `object[]` **properties** **id** `string` An opaque ID for the key. This is the value `api_key_ids` takes on [`/v1/account/spend`](#get-spend). **alias** `string | null` The key's name. **masked** `string | null` The key with most characters hidden. **spend\_usd** `number` Spend metered on this key, in USD. **max\_budget\_usd** `number | null` This key's own spending cap in USD, separate from your wallet. `null` if the key has no cap. **budget\_remaining\_usd** `number | null` `max_budget_usd` minus `spend_usd`. `null` if the key has no cap. **blocked** `boolean` Whether the key is blocked. **created\_at** `string | null` When the key was created, as an ISO 8601 timestamp. **is\_caller** `boolean` `true` for the key that made this request. **count** `integer` The number of keys. ### Get spend `GET /v1/account/spend` Returns spend, requests and tokens for a date range, in one bucket per UTC day. `spend_usd` is the figure your Billing page shows for the same days and models. **start** `string` First day, as `YYYY-MM-DD`. Defaults to the first day of the current month. **end** `string` Last day, inclusive, as `YYYY-MM-DD`. Defaults to today, and a future date is treated as today. The window can span up to 400 days. **group\_by** `string` Breaks each day down by `model`, `api_key`, or both (`model,api_key`). Without it, each day has a single row. **api\_key\_ids** `string` Only include these keys, as a comma-separated list of key `id`s from [`/v1/account/keys`](#list-keys). Every ID must be a current key on your team. **models** `string` Only include these models, as a comma-separated list of model names as the report shows them. Any other name matches nothing. ```bash theme={null} curl "https://api.platform.getimpala.ai/v1/account/spend?start=2026-10-01&end=2026-10-01&group_by=model" \ -H "Authorization: Bearer $IMPALA_API_KEY" ``` ```json theme={null} { "start": "2026-10-01", "end": "2026-10-01", "bucket_width": "1d", "currency": "usd", "group_by": ["model"], "totals": { "spend_usd": 13.91, "prompt_tokens": 41323993, "completion_tokens": 3778884, "cache_read_input_tokens": 29292113, "total_tokens": 45102877, "requests": 6950, "successful_requests": 6946, "failed_requests": 4 }, "buckets": [ { "start": "2026-10-01", "end": "2026-10-02", "totals": { "spend_usd": 13.91, "prompt_tokens": 41323993, "completion_tokens": 3778884, "cache_read_input_tokens": 29292113, "total_tokens": 45102877, "requests": 6950, "successful_requests": 6946, "failed_requests": 4 }, "results": [ { "spend_usd": 11.21, "prompt_tokens": 30120442, "completion_tokens": 2914330, "cache_read_input_tokens": 21880104, "total_tokens": 33034772, "requests": 5402, "successful_requests": 5398, "failed_requests": 4, "model": "glm-5.2", "api_key_id": null, "api_key_alias": null }, { "spend_usd": 2.7, "prompt_tokens": 11203551, "completion_tokens": 864554, "cache_read_input_tokens": 7412009, "total_tokens": 12068105, "requests": 1548, "successful_requests": 1548, "failed_requests": 0, "model": "kimi-k3", "api_key_id": null, "api_key_alias": null } ] } ] } ``` **start, end** `string` The inclusive window the report covers. `start` can be later than requested when your account's history starts later. **bucket\_width** `string` Always `1d`. **currency** `string` Always `usd`. **group\_by** `string[]` The dimensions applied, in the order `model`, `api_key`. **totals** `object` The sum of every row in the report. **properties** **spend\_usd** `number | null` Your billed spend in USD, as your Billing page shows it. `null` on rows split by API key, when `api_key_ids` narrows the report, and on contract plans. **prompt\_tokens** `integer` Input tokens. **completion\_tokens** `integer` Output tokens. **cache\_read\_input\_tokens** `integer` Input tokens served from cache. Included in `prompt_tokens`. **total\_tokens** `integer` Input plus output tokens. **requests** `integer` All requests. **successful\_requests** `integer` Requests that succeeded. **failed\_requests** `integer` Requests that failed. **buckets** `object[]` One entry per UTC day with usage. Days with no usage are left out rather than reported as zeros. **properties** **start** `string` The day. **end** `string` The next day (exclusive). **totals** `object` The day's totals, with the same fields as the report's `totals`. **results** `object[]` One row per group, with the same metrics as `totals` plus `model`, `api_key_id` and `api_key_alias`. A dimension you didn't group by is `null`. `api_key_alias` is also `null` for a key with no alias or a deleted key, so fall back to `api_key_id`. Model names are the ones your dashboard shows; usage that doesn't map to one of them is reported as `(other)`. Token and request counts come from the usage meter, and the API key breakdown is usage only: grouping by `api_key` or filtering with `api_key_ids` returns `spend_usd: null`. Days before your billing started show their usage at `0`. ### Get prices `GET /v1/account/prices` Returns your price list in USD per 1M tokens, the one your Billing page shows. Pay-as-you-go only; other plans get a `404`. ```bash theme={null} curl https://api.platform.getimpala.ai/v1/account/prices \ -H "Authorization: Bearer $IMPALA_API_KEY" ``` ```json theme={null} { "currency": "usd", "models": [ { "model": "glm-5.2", "input_price_per_1m": 0.4, "cached_input_price_per_1m": 0.038, "output_price_per_1m": 1.6 }, { "model": "kimi-k3", "input_price_per_1m": 0.6, "cached_input_price_per_1m": null, "output_price_per_1m": 2.5 } ] } ``` **currency** `string` Always `usd`. **models** `object[]` One row per model on your price list. **properties** **model** `string` The model name. **input\_price\_per\_1m** `number` Price per 1M input tokens. **cached\_input\_price\_per\_1m** `number | null` Price per 1M input tokens served from cache. `null` means cached tokens are billed at the input price. **output\_price\_per\_1m** `number` Price per 1M output tokens. ## Errors Errors return JSON with a `detail` message. Errors specific to this API also carry a `code`: ```json theme={null} { "detail": "window is 412 days; the maximum is 400", "code": "window_too_large" } ``` | Status | `code` | Meaning | | - | - | - | | `401` | `invalid_api_key` | The key is missing, unknown, blocked or expired. | | `409` | `key_has_no_team` | The key isn't attached to a team. Contact Impala to attach it. | | `422` | `invalid_window` | `end` is before `start`. | | `422` | `window_too_large` | The window is longer than 400 days. | | `422` | `invalid_group_by` | `group_by` has a value other than `model` or `api_key`. | | `422` | `unknown_api_key_ids` | `api_key_ids` includes an ID that isn't a current key on your team. The body lists the offending IDs in `api_key_ids`. | Other errors carry no `code`. A date that isn't `YYYY-MM-DD` returns `422` with a list of validation errors in `detail`. `/v1/account/prices` returns `404` on plans other than pay-as-you-go. A `502` means an upstream service didn't answer; retry the request. ## Full example Prints your plan and key, your wallet if you have one, month-to-date spend by day and model, your keys, and your prices where they apply. ```python theme={null} import os import requests BASE = "https://api.platform.getimpala.ai" API_KEY = os.environ["IMPALA_API_KEY"] # your inference key s = requests.Session() s.headers["Authorization"] = f"Bearer {API_KEY}" def get(path, **params): r = s.get(f"{BASE}{path}", params=params, timeout=30) if r.status_code == 404: return None # prices are pay-as-you-go only r.raise_for_status() return r.json() def usd(value): return "n/a" if value is None else f"${value:,.2f}" # spend_usd is null on contract plans # Account: plan, your key, and (pay-as-you-go) wallet acct = get("/v1/account") print(f"team: {acct['team_alias']} ({acct['customer_id']}) plan: {acct['billing_plan']}") k = acct["key"] print(f"this key: {k['alias']} {k['masked']} spent ${k['spend_usd']:.2f}") if "wallet" in acct: w = acct["wallet"] print(f"wallet: funded ${w['funded_cents']/100:.2f} spent ${w['spent_cents']/100:.2f} balance ${w['balance_cents']/100:.2f}") # Spend report: one bucket per UTC day, grouped by model (defaults to month-to-date) report = get("/v1/account/spend", group_by="model") t = report["totals"] print(f"\n{report['start']} → {report['end']}: {usd(t['spend_usd'])} {t['requests']} requests {t['total_tokens']:,} tokens") for day in report["buckets"]: print(f" {day['start']} {usd(day['totals']['spend_usd'])}") for row in day["results"]: print(f" {row['model']:<14} {usd(row['spend_usd']):>12} {row['requests']} req") # Your keys (metadata only) and your per-token prices (USD per 1M tokens) print("\nkeys:") for key in get("/v1/account/keys")["keys"]: print(f" {key['alias'] or key['id'][:12]:<16} ${key['spend_usd']:.2f}") prices = get("/v1/account/prices") if prices is None: print("prices: not applicable on this plan") else: print("prices:") for p in prices["models"]: print(f" {p['model']:<14} in {p['input_price_per_1m']} cached {p['cached_input_price_per_1m']} out {p['output_price_per_1m']}") ``` # Completion windows Source: https://docs.getimpala.ai/completion-windows Choose per request how soon you need the result. Later costs less. Every request runs in a **completion window**. Windows that return sooner cost more, and windows with more time to finish cost less. The model and its output are the same in every window, so the cheapest window your workload can wait for is usually the right one. [Run async and open source](/async-inference) explains why waiting costs less. From fastest to lowest cost, the windows are `asap`, `standard`, `flex` and `batch`. Requests that don't set a window run in `standard`. Each request is billed at its window's rate; see [Pricing](/pricing). ## Which window fits The longer a request can wait, the more efficiently we can run it, and the less it costs. | Window | How it runs | Use it for | | - | - | - | | `asap` | Starts right away | Chat, interactive apps, anyone waiting on the answer | | `standard` | Queued briefly for efficient capacity | Agents, subagents and pipelines running in the background | | `flex` | Scheduled when capacity is cheapest | Evals, enrichment, research, back-office | | `batch` | Submitted as a batch job | Large offline runs: datasets, backfills, synthetic data | Not sure? Start with `standard`, and move work that nobody waits on to `flex` or `batch`. # LiteLLM Source: https://docs.getimpala.ai/connect-litellm Point your LiteLLM gateway at your Impala endpoint. [Connect a LiteLLM gateway to Impala](https://www.loom.com/embed/c71f01fd27d64487bf59bd78b4eb7ceb) ## Prerequisites Impala will provide these values to you ahead of time: * `IMPALA_BASE_URL` — the hostname of your Impala endpoint * `JOB_ID` — an identifier reserved for your account * `MODEL` — the name of the model you are running with Impala (e.g. Qwen2.5-0.5B-Instruct) You'll also need: * LiteLLM installed — either the SDK (`pip install litellm`) or the [LiteLLM Proxy Server](https://docs.litellm.ai/docs/proxy/configs) running in your environment, with access to your * `LITELLM_BASE_URL` * `config.yaml` file **Time to complete:** \~10 minutes *** ## Add Impala to LiteLLM Impala's endpoint is OpenAI-compatible, so LiteLLM can route to it like any other `openai/` provider. Update your `config.yaml` with an entry per model you're running on Impala: ```yaml theme={null} cat > ~/litellm-impala.yaml < [!NOTE] > > Keep `model_name` clear as it will be used as an alias. Note: `model` must be prefixed with "openai/". *** ## Run batch workloads > [!NOTE] > > Impala supports LiteLLM for serverless inference as well. Talk to your Impala contact. Batch runs through the same proxy using pass-through routes. Add these to your `config.yaml` alongside the `model_list` entry, then restart the proxy. `IMPALA_API_KEY` must be set in the environment where the proxy runs. ```yaml theme={null} cat >> ~/litellm-impala.yaml <\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"unlimited\", \"job_id\": \"${JOB_ID}\" }" ``` > [!NOTE] > > The `model` field inside every line of the JSONL input file must exactly match the model that `job_id` is bound to. ### Step C — Poll for status ```bash theme={null} curl ${LITELLM_BASE_URL}/impala-batches/ ``` ### Step D — Download results ```bash theme={null} curl ${LITELLM_BASE_URL}/impala-files//content ``` ### Notes * Batch requests must use the pass-through routes above, not LiteLLM's native `/v1/batches`. * `api_key` in the `model_list` entry is only used for chat completions. The pass-through routes authenticate with their own `Authorization` header. ### Advanced batch configurations (optional) Once you've validated the four curl steps above manually, you can wrap the whole lifecycle (validate, upload, create the batch, poll, download) behind a single CLI command or SDK call for production use. The snippets below are illustrative patterns, not runnable tools: ```bash theme={null} your-batch-cli run requests.jsonl --impala-job-id job-xxxxxxxx ``` or in Python: ```python theme={null} from your_batch_client import BatchAPI api = BatchAPI(base_url="") result = api.run_batch("requests.jsonl", job_id="job-xxxxxxxx", tags={"project": "my-project", "version": "3.1"}) print(result.output_file) ``` **Tag batches**. Some deployments pass an optional `tags` object when creating a batch, which then surfaces in the Impala console for filtering runs by user, team or use case. Reach out to Impala to set this up. **Budget guardrails.** If you want to stop a run early — for example because it's burning through a budget you're tracking via LiteLLM — poll `GET /v1/batches/{batch_id}` as usual and call the documented [Cancel Batch](https://docs.getimpala.ai/api-reference/batches/cancel-batch) endpoint once your own threshold is hit. Output produced *** ## Need help? Reach out to your Impala contact directly. # Run in our cloud, or yours Source: https://docs.getimpala.ai/deployment-options Impala runs in our cloud or inside your own AWS account. ## Serverless We source the GPUs and run your inference on them. You get an endpoint and an API key. Pick this to be running today, or when you'd rather not own capacity planning. Sign up at [platform.getimpala.ai](https://platform.getimpala.ai) to get an endpoint and a key, then see the [Quickstart](/impala-cloud-setup). ## Bring Your Own Cloud Impala's data plane is installed into your own AWS account and VPC. Your prompts, inputs and outputs stay inside your account. Inside your cloud, Impala scales across GPU types and across regions, which keeps availability high and puts each workload on the cheapest capable hardware available at the time. Pick this when data residency or network isolation is a requirement, or when you have committed GPU capacity to use. Setup is a Terraform apply, roughly 30 minutes. See [Install Impala in your VPC](/getting-started-infrastructure-setup). ### Scale to zero New Bring Your Own Cloud data planes have scale to zero turned on by default. When your data plane is idle, its region goes to sleep. Impala scales your workloads down to zero replicas, and no GPU instances managed by Impala's scaler keep running in your account. When you submit a batch, Impala wakes the region back up. The first batch after an idle period waits while the region starts, so it takes longer to begin processing than batches sent while the region is already running. To opt out of scale to zero or change the setting for your data plane, contact your Impala account team. # Expose the OpenAI API endpoint Source: https://docs.getimpala.ai/exposing_the_openai_api_endpoint_service Make your Impala OpenAI API proxy reachable to internal teams and workloads over AWS PrivateLink. As part of your Impala installation, an **OpenAI API proxy** is deployed inside your AWS environment. It is exposed as an **AWS PrivateLink Endpoint Service** — all traffic to the OpenAI API travels over AWS's private network and never touches the public internet. The endpoint service name for your environment is shared during onboarding (format: `com.amazonaws.vpce..vpce-svc-`). This guide covers the most common patterns for making it accessible to your internal teams and workloads. ## What was provisioned The installation creates: * An **internal Network Load Balancer (NLB)** in your EKS VPC, routing traffic to the OpenAI API pods. * An **AWS VPC Endpoint Service** backed by that NLB, enabling PrivateLink-based access from other VPCs or accounts. The endpoint service is the entry point. Depending on where your consumers live, choose one of the options below. ## Option 1 — Same VPC (simplest) **Use when:** * The workloads that need OpenAI API access run in (or have networking access to) the Impala VPC. * The identities that need OpenAI API access have access to the Impala VPC (via VPC peering or Site-to-Site VPN). No PrivateLink consumer endpoint is needed — the NLB is already reachable within the VPC. **Steps:** 1. Retrieve the NLB DNS name from your Impala installation outputs (`openai_privatelink_nlb_dns` or equivalent). 2. *(Optional)* Create a **Route 53 private hosted zone record** in your VPC: * Type: `CNAME` * Name: e.g. `openai.` * Value: the NLB DNS name 3. Workloads call `http://openai.` — done. ## Option 2 — Different VPC, same account **Use when:** consuming workloads or a corporate VPN terminate in a different VPC within the same AWS account. **2.1 — Add the target region to the endpoint service** *(only if the consumer VPC is in a different region)* 1. AWS Console → switch to the EKS region → **VPC → Endpoint Services**. 2. Open the `-openai` endpoint service → **Allowed regions** tab → **Allow regions** → add your target region. **2.2 — Create the consumer endpoint** *(in the consumer VPC's region)* 1. **VPC → Endpoints → Create endpoint**. 2. Type: **Endpoint services that use NLBs and GWLBs**. 3. Service name: paste your endpoint service name → **Verify**. 4. VPC: select the consumer VPC. 5. Subnets: select **private subnets** in each AZ where consumers run. 6. Security group: allow **inbound TCP 80** from the VPC CIDR (or tighter, scoped to specific security groups). 7. Leave **Enable private DNS** unchecked. 8. Create the endpoint. **2.3 — Approve the connection** *(back in the EKS region)* 1. **VPC → Endpoint Services** → open the `-openai` service. 2. **Endpoint connections** tab → select the pending request → **Actions → Accept**. **2.4 — DNS** 1. Copy the endpoint's DNS name from **VPC → Endpoints → Details**. 2. In Route 53, open or create a **private hosted zone** associated with the consumer VPC. 3. Add a `CNAME` record: e.g. `openai.` → endpoint DNS name. ## Option 3 — Different account (cross-account PrivateLink) **Use when:** the consuming team or workload is in a separate AWS account (e.g. a shared services account or a partner account). **3.1 — Allow the other account** *(in the endpoint service's account)* 1. **VPC → Endpoint Services** → open the `-openai` service. 2. **Allow principals** tab → **Allow principals** → add the consumer account root (or scope it to a specific IAM role for tighter control): ```text theme={null} arn:aws:iam:::root ``` **3.2 — Create the consumer endpoint** *(from the consumer account)* Same as steps 2.2–2.4 above, performed from the consumer account's console. **3.3 — Approve the connection** *(from the endpoint service's account)* Same as step 2.3 above. ## Option 4 — Transit Gateway (hub-and-spoke) **Use when:** you have multiple VPCs across accounts or regions that all need access, and you want centralized routing rather than creating a consumer endpoint in every VPC. **Architecture:** * Create the consumer endpoint once in a **shared services VPC**. * Attach that VPC to your **Transit Gateway**. * All spoke VPCs route traffic to the shared services VPC via the TGW. * DNS resolves to the endpoint ENI in the shared VPC; traffic is routed through the TGW. This avoids per-VPC endpoint setup at the cost of Transit Gateway data processing charges. ## Validating connectivity Once set up, test from a workload or machine in the consumer VPC: ```bash theme={null} # Confirm DNS resolves to a private IP nslookup openai. # Test connectivity against the health endpoint curl -v http://openai./health ``` Expected: DNS resolves to a `10.x.x.x` address and the health check returns `200 OK`. ## Summary | Option | Best for | Complexity | | - | - | - | | Same VPC | Workloads in the EKS VPC | Low | | Different VPC, same account | Separate VPCs or VPN in same account | Medium | | Cross-account | Partner or multi-account orgs | Medium | | Transit Gateway | Large multi-VPC environments | High | ## Need help? Reach out to your Impala contact directly. # Further reading Source: https://docs.getimpala.ai/further-reading Impala's engineering writing on inference economics, kernels and expert parallelism. **[Research](https://www.getimpala.ai/research)** — The engine and its measured results. ## Cost and utilization **[Run It Hot](https://www.getimpala.ai/blog/run-it-hot)** — Why utilization, not electricity price, is the lever on cost per token. ## Workload shape **[Nobody's Waiting: Common Use Cases for Async AI](https://www.getimpala.ai/blog/nobodys-waiting-common-use-cases-for-async-ai)** — The share of inference where no human is reading the output, and what that changes. **[Inference for Agentic Workloads Is Different](https://www.getimpala.ai/blog/inference-for-agentic-workloads-is-different-heres-what-that-means-for-your-stack)** — Why agent traces break the assumptions interactive serving is built on. ## Engine internals **[DBO, Kernel Crossover, and the Real Hardware Cliff](https://www.getimpala.ai/blog/wide-ep-dbo-deepep-hardware-cliff)** — Where kernel choice stops scaling and what replaces it. **[Wide-EP failure modes, load balancing, and portability](https://www.getimpala.ai/blog/wide-ep-load-balancing-portability)** — Expert parallelism at fleet scale, and how it fails. ## Building the platform **[IaC You Can Reason About](https://www.getimpala.ai/blog/iac-you-can-reason-about)** — Part 1 of the DevOps series. **[What Full BYOC Actually Takes](https://www.getimpala.ai/blog/what-full-byoc-actually-takes)** — Part 2, on deploying into [your own cloud](/getting-started-infrastructure-setup). # Install Impala in your VPC Source: https://docs.getimpala.ai/getting-started-infrastructure-setup Deploy the Impala data plane in your AWS account. Impala runs in your AWS account. This guide walks you through deploying the Impala data plane — from downloading the deployment package to your active platform. ## Prerequisites * An Impala invitation from your Impala contact * Terraform installed (use the latest version — [terraform.io](https://terraform.io)) * AWS credentials configured on the machine you'll run the deployment from **Time to complete:** \~30 minutes (a few minutes setup, then automated deployment) *** ## Step 1 — Download the deployment package 1. Log in to the Impala platform using the link in your invitation email 2. You'll land on the **Infrastructure Setup** page 3. Click **Download Assets** — this downloads `terraform-assets.zip` ![The Setup tab under Admin on the Impala platform, showing the Download Assets button and the deployment commands](https://mintcdn.com/impalaai/D6PXSk0MrZyYwOiY/infrastructure-setup.png?fit=max\&auto=format\&n=D6PXSk0MrZyYwOiY\&q=85\&s=22914c328f8d0c3d2e7c74ea409f48b8) *** ## Step 2 — Run the deployment script Open a terminal and run: ```bash theme={null} unzip terraform-assets.zip ./deploy.sh --tfvars-file terraform.tfvars --local-backend ``` The script deploys all infrastructure stacks in the correct order. This takes approximately **30 minutes**. > [!WARNING] > > During the deployment, a browser window will open automatically. Log in with your Impala credentials when prompted — this completes the infrastructure registration. Don't close the terminal while this is running. *** ## Step 3 — Wait for activation Once the script finishes and you've logged in during the process, your infrastructure registers automatically. Go back to the Impala platform — it will update to confirm your environment is ready. No further action needed. If the page hasn't updated after the script completes, use the **"Registration didn't work? Submit output manually"** option on the setup page to send the deployment output to Impala's team. *** ## You're in! Once activation is confirmed, you'll land on the Impala dashboard. You'll see your run history, cost, and token usage here. ![The Impala platform home page, showing total cost, total runs and total tokens alongside links to models, docs and the blog](https://mintcdn.com/impalaai/D6PXSk0MrZyYwOiY/platform-home.png?fit=max\&auto=format\&n=D6PXSk0MrZyYwOiY\&q=85\&s=b2894c57116812e94a42e18eb61ac70e) From the sidebar you can: * **Home** — dashboard overview: cost, runs and token usage * **Run** — your batch runs and their status * **Usage** — cost and token usage over time * **Models** — the models available to you * **Playground** — test models directly from the UI * **Admin** — members, API keys, and this setup page A run's cost appears as soon as its first part is priced. While the cost is pending, it shows the cost so far and can still grow. It becomes final about 1–2.5 minutes after the run's last part ends. Cost figures appear only if your team is shown pricing. Your next step is running your first batch. See: [**Upload and run your first batch**](run-your-first-batch) ## Need help? Reach out to your Impala contact directly. # Glossary Source: https://docs.getimpala.ai/glossary The vocabulary these docs use for async inference, agent workloads and Impala's own objects. ## Workloads | Term | Meaning | | - | - | | **Interactive AI** | A person reads tokens as they stream. Measured by interactivity SLOs. | | **Async AI** | No human waiting on each token — background agents, research agents, multi-step automations, enrichment jobs. The target is tasks per dollar. | | **Agent / harness** | The software running the loop: calls the model, executes tools, branches, retries, fans out, decides when it's done. | | **Subagent / fan-out** | A child agent spawned by a parent, usually grounded in a shared parent context and often running alongside siblings. | ## Units of work | Term | Meaning | | - | - | | **Trace** (rollout) | One full agent run: an ordered sequence of model calls, reasoning and tool executions, where each step's output feeds the next step's input. | | **Step** (turn) | A single round inside a trace: one model generation, typically followed by one tool call. | | **Tool-call gap** | The idle stretch between issuing a tool call and getting its result back. | | **Prefix** | The shared, growing input every step re-reads: system prompt, tool schemas, accumulated trace history. | ## Metrics | Term | Meaning | | - | - | | **Tasks per dollar** | Cost per completed task. The economic SLO for async work. | | **Task completion time** | Wall-clock from submitting a task to completion. | | **Throughput** | How fast the cluster turns work out at scale. | | **TTFT / TPOT / ITL** | Time to first token, time per output token, inter-token latency. Interactive SLOs — not the target here. | ## Runtime | Term | Meaning | | - | - | | **KV cache** | The per-request intermediate state the model carries across tokens. | | **Prefix caching** | Reusing KV state across steps and traces that share an input prefix, instead of recomputing it. | | **Continuous batching** | Requests join and leave a running batch rather than waiting for a batch boundary. | | **Tiered memory** | KV blocks live on different memory tiers and move between them as needed. | ## Impala objects | Term | Meaning | | - | - | | **Herd** | Impala's inference engine. Profiles your live traffic and re-tunes its execution plan against it — kernels, batching, decoding. Every workload runs on it; nothing about it is yours to configure. See [Impala Herd](/impala-herd). | | **Leap** | Live weight iteration: swap the weights a running fleet serves, in seconds, with no redeploy. Herd runs your inference; Leap changes your weights. See [Impala Leap](/weight-sync). | | **Job** | A model plus a configuration, provisioned for your account, identified by a `job_id`. Passing one is optional; without it, Impala picks the job. See [Jobs](/jobs-and-job-ids). | | **Run** | One execution of a batch against a job. What the Run tab lists. | | **Batch** | The API object created by `POST /v1/batches`, moving through `validating` → `in_progress` → `finalizing` → `completed`. | | **Data plane** | The components that actually run inference: model servers, scheduler, and the storage they read and write. | ## Aliases you may hear | Term | Meaning | | - | - | | **Serverless** | Inference on Impala's cloud, no install. See [Run in our cloud, or yours](/deployment-options). | | **BYOC** | Impala's data plane running inside your own cloud. See [Run in our cloud, or yours](/deployment-options). | # Quickstart Source: https://docs.getimpala.ai/impala-cloud-setup Get your endpoint and key, then send your first request. ## 1. Get your endpoint and key Sign up at [platform.getimpala.ai](https://platform.getimpala.ai) or talk to your Impala contact to get a serverless endpoint with the details below. | Value | What it is | | - | - | | `BASE_URL` | Your inference endpoint. Endpoints differ between accounts — use yours exactly as provided, without adding or stripping a path. | | `MODEL` | The model your endpoint is provisioned for | | `API_KEY` | Your account's API key. Send it as a bearer token on every request. | You can create more keys under **API Keys** on the platform. ## 2. Install the SDK Impala is OpenAI-compatible, so use the official `openai` package. ```bash theme={null} pip install openai ``` ## 3. Send your first request Fill in your three values and run it. ```python Python theme={null} from openai import OpenAI client = OpenAI( base_url="", api_key="", timeout=600.0, ) resp = client.chat.completions.create( model="", messages=[ {"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "What is 17 times 3? Answer with just the number."}, ], ) print(resp.choices[0].message.content) ``` ```bash cURL theme={null} curl "/chat/completions" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ --max-time 600 \ -d '{ "model": "", "messages": [{"role": "user", "content": "What is 17 times 3?"}] }' ``` ## 4. Check it worked A response with no error means your endpoint, key and model are working end to end. ## Next > **[Chat completions](/send-a-request)** > > The request shape, streaming, timeouts and parameters. > **[Run a batch](/run-your-first-batch)** > > File in, results out, at the lowest cost per token. Bring Your Own Cloud installs differently — see [Install Impala in your VPC](/getting-started-infrastructure-setup). # Impala Herd Source: https://docs.getimpala.ai/impala-herd Herd is the inference engine every Impala workload runs on. It reads the shape of your live traffic and reconfigures itself around it — kernels, batching, decoding. Every workload on Impala runs on **Herd** — batch or single request, our cloud or yours. You don't select it, configure it, or opt into it. It is the reason the cost per token looks the way it does. Most inference stacks run someone else's defaults: a fixed execution plan chosen at deploy time, tuned for a workload that isn't yours. Herd reads the shape of your live traffic and reconfigures itself around it. > **Up to 300%** > > More token throughput on the same hardware. > **Lower PPMT** > > Throughput lands directly on price per million tokens. > **Zero changes** > > Same models, same API, same prompts. ## What adapts **Adaptive engine.** Herd profiles your live traffic — prompt lengths, burstiness, cache reuse, concurrency — and re-tunes its execution plan against what it observes, continuously, rather than fixing a plan at deploy time. **State-of-the-art kernels.** Kernel tuning, selection and optimization, aimed at using every FLOP and every byte of memory bandwidth the device has. **Custom speculators.** Herd auto-selects the best speculator for your workload, lifting throughput while preserving your target model's behavior — the outputs are the model's, not the speculator's. ## Why this shows up as cost, not speed Throughput and unit cost are the same number viewed from two sides: a GPU costs the same per hour saturated or idle, so the tokens it produces per hour set the price of each one. Herd's job is to raise that number on hardware you're already paying for. What it does not do is make an individual request return faster. That trade is deliberate, and [Run async and open source](/async-inference) explains why it's the right one for async work. ## What you don't have to do * No engine flags, batch sizes or scheduling policies to tune * No prompt rewriting * No model changes — Herd serves the model you asked for, with its behavior intact * No migration; the API surface is unchanged Adaptation happens on Impala's side of the endpoint. From your code, Herd is invisible. Herd runs your inference. [Leap](/weight-sync) changes your weights. ## Benchmark it on your own workload Impala will benchmark your own traffic and models, no migration required. Send a week of traffic and get the numbers back. Talk to your Impala contact to set it up. ## Further reading * [Run It Hot](https://www.getimpala.ai/blog/run-it-hot) — why utilization, not electricity price, is the lever on cost per token * [DBO, Kernel Crossover, and the Real Hardware Cliff](https://www.getimpala.ai/blog/wide-ep-dbo-deepep-hardware-cliff) — where kernel choice stops scaling * [Wide-EP failure modes, load balancing, and portability](https://www.getimpala.ai/blog/wide-ep-load-balancing-portability) — expert parallelism at scale # Introduction Source: https://docs.getimpala.ai/introduction The most intelligence per dollar on any open-source model, running on your reserved throughput or in your own cloud. Unlike inference solutions optimized for chat-speed latency, Impala is **purpose-built for high-volume asynchronous workloads**. By dynamically adapting to real workload shapes across heterogeneous GPU infrastructure, Impala delivers **up to 10x lower cost per token** compared to leading inference platforms. ## Start here > **[Start running today](https://platform.getimpala.ai)** > > Sign up on the Impala platform, get a serverless endpoint and an API key, and send your first request. > **[Quickstart](/impala-cloud-setup)** > > Endpoint, key, one call. The fastest way to start running. > **[Run a batch](/run-your-first-batch)** > > Upload a JSONL file, create a batch, collect the results. > **[Run async and open source](/async-inference)** > > Why our metric is tasks per dollar, and what high latency buys you. > **[Deployments](/deployment-options)** > > Serverless in our cloud, or bring your own cloud. ## How it works Impala is built to adapt to your workloads in real time through **async adaptive scheduling**. It treats inference as **a high-performance computing problem**. It runs in Impala's cloud, or inside your own VPC. Impala is **vertically integrated across the entire stack** — optimizing end-to-end from kernels to orchestration. ## Use cases Agents and multi-step pipelines, where each step is its own request: * **Background coding agents** — repo-wide refactors, dependency migrations, test generation, automated PR review * **Research agents** that plan, search and synthesize across dozens of turns * **Agentic pipelines** that plan, execute, evaluate and retry until the task is done * **MCP tool orchestration** across many servers and long-running sessions * **Subagent fan-out**, where one parent spawns dozens of children over a shared context Batch work, where the whole input set is known up front: * **Evaluation sweeps and rollouts** — the same harness over a fixed set, run to completion * **Corpus-scale extraction and summarization** across document stores * **Classification and enrichment** over millions of records * **Training-data curation and labeling**, including synthetic generation * **Scheduled reporting** — compliance and risk analysis, AI-enriched nightly ETL The first is served by [single requests](/send-a-request) at scale and [agent orchestration](/swarm); the second by [Batch](/run-your-first-batch). # Jobs Source: https://docs.getimpala.ai/jobs-and-job-ids A job is a model plus a configuration, provisioned for your account. Passing a job ID is optional; without one, Impala picks the job for you. Every batch run on Impala is served by a **job**. Passing a `job_id` is optional. Without one, Impala picks the job for you, based on the model you request and your agreement with us. ## What a job is A job is a **model plus a configuration**, provisioned for your account and identified by a `job_id` that looks like `job-xxxxxxxx`. The configuration is the part that matters for throughput: which model weights are loaded, how they're quantized, what hardware shape they run on, and how the scheduler treats the workload. Impala provisions a job for you rather than having you assemble those choices per request, which is how a batch run reaches its cost per token. Practically, this means: * You don't pick a model and a machine type at request time. You name the model, and optionally a job. * Two jobs can serve the same model with different configurations. * A model that isn't provisioned for your account can't be batched yet. Ask your Impala contact to provision it. * Some models have separate reasoning and standard jobs. Others serve both from one job and switch per request. See [Reasoning](/send-a-request#reasoning). * A job can include your own [LoRA adapter](/lora-adapters). ## Finding your job IDs The **Run** tab in the Impala console lists every job ID available to your workspace, with one-click copy. That list is the definitive answer to "what can we run" — not the model catalog in the Playground, which exists for exploration and does not imply batch availability. ## Using a job ID Pass `job_id` when you want a specific configuration, for example to choose between two jobs that serve the same model. Leave it out and Impala routes the batch for you. To pin a job, pass `job_id` when you create the batch: ```bash theme={null} curl -X POST "$BASE_URL/v1/batches" \ -H "Content-Type: application/json" \ -d '{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "unlimited", "job_id": "job-xxxxxxxx" }' ``` The OpenAI SDK has no `job_id` parameter, so pass it through `extra_body`: ```python theme={null} batch = client.batches.create( input_file_id=file.id, endpoint="/v1/chat/completions", completion_window="unlimited", extra_body={"job_id": "job-xxxxxxxx"}, ) ``` ## The model has to match Every line of your JSONL carries a `model` field. If you pass a `job_id`, it must name the same model the job is bound to. ```json theme={null} {"custom_id":"req-1","method":"POST","url":"/v1/chat/completions","body":{"model":"your-model","messages":[{"role":"user","content":"..."}]}} ``` If `body.model` and the job's model disagree, the request fails. Two habits that prevent it: * Generate the JSONL from a single constant rather than typing the model name per line. * Keep one job ID per pipeline, so the pairing lives in one place in your config. > [!NOTE] > > `url` in each line must also match the `endpoint` you passed when creating the batch. ## Need help? Reach out to your Impala contact directly. # LoRA adapters Source: https://docs.getimpala.ai/lora-adapters Serve your fine-tuned model on Impala. Bring a LoRA adapter, and we deploy it for you to call through serverless or batch. Impala serves models fine-tuned with **LoRA** (low-rank adaptation). You bring the adapter, we deploy it with its base model, and you send requests to it through serverless or batch. ## What to send us Either form works: * **A separate adapter**, alongside the name of the base model it was trained on. * **A merged model**, with the adapter weights already folded into the base model. Contact your Impala account team to share it. ## How it's served The adapter is loaded with the model when it's deployed, so every request to that deployment uses it. Switching adapters per request isn't supported yet. ## Sending requests Send requests exactly as you would. See [Chat completions](/send-a-request) for serverless and [Run a batch](/run-your-first-batch) for batch. To run a batch on an adapter you upload yourself, see [LoRA adapters in batch](/lora-batch). If you retrain full weights often, [Impala Leap](/weight-sync) swaps new checkpoints onto a running deployment without a redeploy. # LoRA adapters in batch Source: https://docs.getimpala.ai/lora-batch Run a batch on your own fine-tune. Put the adapter in your data plane's resources bucket and name it in the model field. A batch on a [LoRA adapter](/lora-adapters) is a normal [batch](/run-your-first-batch) with two differences: the adapter lives in your data plane's resources bucket, and each request names it in `model`. ## Upload the adapter Export the adapter in PEFT format, trained on the same base model you run the batch on. The adapter folder must meet these requirements: * It contains `adapter_config.json` and `adapter_model.safetensors` at its top level, and nothing else. * Rank is 16 or less. * It's plain LoRA, with no DoRA and no bias terms. Copy the folder to `loras//` in your data plane's resources bucket. The bucket name is the Terraform output `s3_resources_bucket_name` and ends in `-resources`. ```bash theme={null} aws s3 cp ./support-classifier-v1/ \ s3://acme-impala-data-bucket-7f3k2-resources/loras/support-classifier-v1/ \ --recursive ``` Adapter names use letters, digits, `.`, `_` and `-`, and start with a letter or digit. ## Name the adapter in `model` Set `model` to `ft::`. A batch runs on a single adapter. The adapter is loaded once when the batch starts and isn't swapped per request, so every line in the input file must use the same `model` value. You can't mix adapters, or an adapter and its base model, in one batch. To run several adapters, submit one batch per adapter. ```json theme={null} {"custom_id":"ticket-0001","method":"POST","url":"/v1/chat/completions","body":{"model":"ft:microsoft/Phi-3.5-mini-instruct:support-classifier-v1","messages":[{"role":"user","content":"Classify this ticket: My invoice shows a charge I don't recognize."}],"max_tokens":50,"temperature":0}} ``` ## Submit the batch Upload the file and create the batch as you would for a base model. `completion_window` must be `"unlimited"`. ```bash theme={null} curl -X POST "$BASE_URL/v1/files" \ -H "Authorization: Bearer $IMPALA_API_KEY" \ -F "purpose=batch" \ -F "file=@input.jsonl" curl -X POST "$BASE_URL/v1/batches" \ -H "Authorization: Bearer $IMPALA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "unlimited" }' ``` Poll the batch and download results the same way as any other batch. See [Run a batch](/run-your-first-batch). > [!WARNING] > > The adapter isn't checked when you create the batch. If it's missing from the bucket or doesn't meet the requirements above, the batch doesn't start. Check the adapter path and files before you submit. # Images Source: https://docs.getimpala.ai/pass_images_with_image_url Send images to batch chat-completion requests by S3 reference instead of inline base64. This guide shows how to include images in your batch inference requests by **reference**, using an `image_url` content part whose `url` points to an object in S3 (`s3://…`) — instead of embedding a base64-encoded image inline in your JSONL. This works with the `/v1/chat/completions` endpoint and follows the OpenAI-compatible multimodal message format. If you haven't run a batch yet, start with [Upload and run your first batch](/run-your-first-batch). ## Why image\_url instead of base64 Base64 encoding inflates each image by \~33% and embeds the entire payload directly in your input file. For image-heavy workloads (computer vision, data labeling, document processing), that adds up fast. Referencing images by S3 URL instead means: * **Smaller JSONL** — each request carries a short URL, not a multi-megabyte string. Easier to stay under the input file limits (up to 50,000 requests and 200 MB per file). * **No encode/decode step** — point at images already in your bucket; no preprocessing pipeline to base64-encode them. * **Cross-region** — the source image can live in an S3 bucket in a different region than where the batch runs. See [Cross-Region Image URI](/changelog) (May 3, 2026). ## Message format Set the message `content` to an **array** of parts. Use an `image_url` part for the image and a `text` part for the prompt: ```json theme={null} { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": "s3://my-bucket/parts/42/perfectFeb26/TSR/img_76121.png" } }, { "type": "text", "text": "Cluster the image to its matching category from the provided category list and output ONLY the JSON object in the specified format." } ] } ``` The `url` field accepts an `s3:///` URI. The bucket must be reachable by your Impala data plane (see [S3 access](#s3-access) below). ## Full JSONL example Each line of your input file is one request. Here `input.jsonl` contains two image requests for `/v1/chat/completions`: ```json theme={null} {"custom_id":"req-1","method":"POST","url":"/v1/chat/completions","body":{"model":"your-model","messages":[{"role":"user","content":[{"type":"image_url","image_url":{"url":"s3://my-bucket/parts/img_76121.png"}},{"type":"text","text":"Cluster the image to its matching category and output ONLY the JSON object in the specified format."}]}]}} {"custom_id":"req-2","method":"POST","url":"/v1/chat/completions","body":{"model":"your-model","messages":[{"role":"user","content":[{"type":"image_url","image_url":{"url":"s3://my-bucket/parts/img_76122.png"}},{"type":"text","text":"Cluster the image to its matching category and output ONLY the JSON object in the specified format."}]}]}} ``` You can mix a system message and multiple images in a single request — the `content` array can hold any number of `image_url` and `text` parts. ## Run it The rest of the flow is identical to a text-only batch — upload the file, create the batch against `/v1/chat/completions`, poll for status, then download the results: ```bash theme={null} # 1. Upload the input file curl -X POST "$BASE_URL/v1/files" \ -F "purpose=batch" \ -F "file=@input.jsonl" # 2. Create the batch (use the file id from step 1) curl -X POST "$BASE_URL/v1/batches" \ -H "Content-Type: application/json" \ -d '{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "unlimited", "job_id": "job-xxxxxxxx" }' ``` For the full walkthrough — polling status and downloading the output file — see [Upload and run your first batch](/run-your-first-batch). ## S3 access The bucket referenced in each `image_url` must be reachable by your Impala data plane: * The objects must exist and be readable by the role Impala uses to run your batch. * The source bucket may be in a different region than the batch — cross-region image URIs are supported, so your JSONL and the data plane no longer need to be co-located. If a request's image can't be fetched, that line fails and appears in the batch's `error_file_id` (other requests are unaffected). ## Need help? Reach out to your Impala contact directly. # Rate limit webhooks Source: https://docs.getimpala.ai/rate-limit-webhooks Get an event when your team's RPM or TPM limit changes, so your router can follow it. Impala can send a webhook to your endpoint whenever we change the RPM or TPM limit on your team. If you route traffic across several providers, your router can follow our capacity as it changes, instead of finding out from `429` responses. Webhooks are enabled per team on request. Contact your Impala account team to turn them on. ## Set up an endpoint 1. Ask your Impala account team to enable webhooks for your team. 2. In [Settings](https://platform.getimpala.ai/settings), add an HTTPS endpoint that accepts `POST` requests. 3. Ask us to send a test event and check that it arrives. Each event carries your team's new RPM and TPM limits. We share the exact event format when we enable webhooks for your team. ## Route with the limits Set Impala's weight in your router so your expected peak stays under the new limits, and send overflow to another provider. Requests above the limit return `429`. Rejected requests appear as request errors on the Usage page. Before your router acts on events, log a few and check that your update logic would have produced the routing you expect. # Run a batch Source: https://docs.getimpala.ai/run-your-first-batch This guide shows how to submit batch inference to your Impala endpoint using the OpenAI-compatible API. You’ll upload an input file, then create a batch. [Run a batch on Impala](https://www.loom.com/embed/1f544db701954b3bb7775208edc173ae) ## Prerequisites Impala will provide these values to you ahead of time: * **`BASE_URL`** — the hostname of your Impala endpoint * **`JOB_ID`** (optional) — pins the batch to a specific inference configuration. Without it, Impala picks one based on the model and your agreement. See [Jobs](/jobs-and-job-ids). * Create an API key in Settings on platform.getimpala.ai, and send it as a bearer token on every request: `-H "Authorization: Bearer $IMPALA_API_KEY"`. (BYOC deployments can disable API keys; if yours is disabled, omit the header.) Use these values exactly as provided. *** ## Step 1 — Prepare your input file (JSONL) The input file must be **JSONL** (one JSON object per line). Each line represents one request to the inference endpoint you want to target (e.g. `/v1/chat/completions`). Example `input.jsonl` for chat completions: ```text theme={null} {"custom_id":"req-1","method":"POST","url":"/v1/chat/completions","body":{"model":"your-model","messages":[{"role":"user","content":"Summarize: ..."}]}} {"custom_id":"req-2","method":"POST","url":"/v1/chat/completions","body":{"model":"your-model","messages":[{"role":"user","content":"Translate: ..."}]}} ``` *** ## Step 2 — Upload the input file Upload your JSONL file using the OpenAI-compatible Files API: ```bash theme={null} curl -X POST "$BASE_URL/v1/files" \ -F "purpose=batch" \ -F "file=@input.jsonl" ``` Response (truncated): ```json theme={null} { "id": "file-abc123", "object": "file", "bytes": 12345, "filename": "input.jsonl", "purpose": "batch" } ``` Save the `id` — you’ll use it as `input_file_id` in the next step. *** ## Step 3 — Create the batch ```bash theme={null} curl -X POST "$BASE_URL/v1/batches" \ -H "Content-Type: application/json" \ -d '{ "input_file_id": "file-abc123", "endpoint": "/v1/chat/completions", "completion_window": "unlimited", "job_id": "job-xxxxxxxx" }' ``` Request fields: | Field | Value | | - | - | | input\_file\_id | The id returned by Step 2 | | endpoint | One of /v1/chat/completions, /v1/completions, /v1/embeddings, /v1/responses — must match the url field in each JSONL line | | completion\_window | "unlimited" | | job\_id | Optional. A Job ID supplied to you by Impala (job-xxxxxxxx) | The response includes an `id` for the batch (for example, `batch-xyz789`). *** ## Step 4 — Poll for status ```bash theme={null} curl "$BASE_URL/v1/batches/batch-xyz789" ``` The batch `status` will move through: `validating` → `in_progress` → `finalizing` → `completed` (or `failed` / `expired`) When the batch is `completed`, the response includes: * `output_file_id` — a file containing successful responses * `error_file_id` — a file containing failed requests (only present if any requests failed) *** ## Step 5 — Download results ```bash theme={null} curl "$BASE_URL/v1/files//content" > output.jsonl ``` The output file is JSONL: one response per line, matched to your input using `custom_id`. *** ## Using the OpenAI Python SDK The endpoint is OpenAI-compatible. Point `base_url` to your Impala endpoint: ```python theme={null} from openai import OpenAI client = OpenAI( base_url="/v1", # use your Impala base URL api_key="reserved", # placeholder (not used today) ) # 1. Upload with open("input.jsonl", "rb") as f: file = client.files.create(file=f, purpose="batch") # 2. Create batch batch = client.batches.create( input_file_id=file.id, endpoint="/v1/chat/completions", completion_window="unlimited", extra_body={"job_id": "job-xxxxxxxx"}, ) # 3. Poll batch = client.batches.retrieve(batch.id) print(batch.status) # 4. Download when completed if batch.status == "completed": content = client.files.content(batch.output_file_id) with open("output.jsonl", "wb") as f: f.write(content.content) ``` Note: `job_id` is optional. If you pass it, the OpenAI SDK doesn’t expose a `job_id` parameter, so use `extra_body` as shown. *** ## API reference * `POST /v1/files` — upload * `GET /v1/files/{file_id}` — metadata * `GET /v1/files/{file_id}/content` — download * `POST /v1/batches` — create * `GET /v1/batches/{batch_id}` — status * `GET /v1/batches` — list ## Need help? Reach out to your Impala contact directly. # Security & data handling Source: https://docs.getimpala.ai/security Impala runs single-tenant, in our cloud or in yours. Your data stays isolated and isn't stored. Every Impala deployment is **single-tenant** and logically isolated from other customers, so your data and operations remain separate and secure. That is true in both [deployment shapes](/deployment-options): an isolated deployment in Impala's cloud, or Impala's data plane inside your own AWS account and VPC, where your prompts, inputs and outputs never leave your account. Either way, **prompts are not persisted** and **your data is never used for training** — not for model training, not for fine-tuning, not for model improvement. What Impala keeps is the shape of the workload, not what's in it: prompt lengths, concurrency, burstiness, cache reuse. That's what [Herd](/impala-herd) profiles to tune the execution plan. Impala is certified under **SOC 2 Type II** and security-tested on a regular cadence, including vulnerability assessments and penetration testing. > **[Impala Trust Center](https://trust.getimpala.ai)** > > SOC 2 Type II status, security controls, subprocessors and documents. Self-serve and current. For anything specific to your environment, refer to the Trust Center or talk to your Impala contact. # Chat completions Source: https://docs.getimpala.ai/send-a-request The request shape, the parameters that matter for async work, and what changes from OpenAI. Impala serves an OpenAI-compatible `/chat/completions` endpoint. The change is the base URL, the key, and the model name — see [Quickstart](/impala-cloud-setup) for those three values. ## The request `model` and `messages` are the only required fields. ```python theme={null} resp = client.chat.completions.create( model="", messages=[{"role": "user", "content": "Summarize this ticket in one line."}], ) print(resp.choices[0].message.content) ``` `messages` is the standard OpenAI chat format. A `system` message sets behavior, `user` carries the prompt, and `assistant` carries prior model turns when you're replaying a conversation: ```python theme={null} messages=[ {"role": "system", "content": "You are a concise assistant."}, {"role": "user", "content": "What changed in this diff?"}, {"role": "assistant", "content": "Two functions were renamed."}, {"role": "user", "content": "Which ones?"}, ] ``` `base_url` routes your requests to Impala. Pass it exactly as provided — endpoints differ between accounts. `model` names the model your endpoint is provisioned for. ## Timeouts and retries Two settings matter more here than at an interactive provider. **Raise your timeouts.** A call takes seconds, and minutes under load. SDK defaults are tuned for interactive providers and will abort a request that would have succeeded. **Reduce automatic retries.** The SDK can't tell a slow request from a failed one, so its default retries fire on timeouts for requests that are still running — adding load without shortening your wait. Lower the count and raise the timeout instead. Set it to `0` if your own harness handles retries. ```python theme={null} client = OpenAI( base_url="", api_key="", timeout=600.0, max_retries=1, ) ``` For an agent, total time is per-step time multiplied by the number of steps, so turn count is usually a bigger lever than any individual call. See [Run async and open source](/async-inference). ## Keep the key out of your source The OpenAI SDK reads these environment variables automatically: ```bash theme={null} export OPENAI_BASE_URL="" export OPENAI_API_KEY="" ``` Which lets your code drop the explicit arguments: ```python theme={null} from openai import OpenAI client = OpenAI() # reads OPENAI_BASE_URL and OPENAI_API_KEY resp = client.chat.completions.create( model="", messages=[{"role": "user", "content": "Ping"}], ) ``` Don't commit your key or share it outside your team. You can rotate it under **API Keys** on the platform. ## Other parameters The endpoint accepts the standard OpenAI chat completion fields. Sampling parameters in the request body, such as `temperature`, `top_p`, `top_k`, `min_p` and `max_tokens`, are passed through to the inference engine as sent. In a batch, put them in the `body` of each JSONL line. ## Reasoning Some models are provisioned as two jobs, one with reasoning and one without. Others, such as Qwen3.8, serve both from one job, with thinking on by default. For those, control it per request through `chat_template_kwargs`. To turn thinking off: ```json theme={null} {"chat_template_kwargs": {"enable_thinking": false}} ``` To set how much the model reasons, pass `reasoning_effort`. Supported values are `xhigh` (the default), `medium` and `low`. Any other value, including `high`, returns an error. ```json theme={null} {"chat_template_kwargs": {"reasoning_effort": "medium"}} ``` With the OpenAI SDK, pass `chat_template_kwargs` through `extra_body`. In a batch, add it to the `body` of each JSONL line. ## Next > **[Run a batch](/run-your-first-batch)** > > File in, results out, at the lowest cost per token. > **[Anthropic SDKs and Claude Code](/anthropic-sdk)** > > The same endpoint in Anthropic format. # Impala Swarm Source: https://docs.getimpala.ai/swarm Run an agent swarm on Impala — the harness, the fan-out and the model calls in one place, next to your data. **Impala Swarm** is a way to run an agent swarm on Impala: a parent agent that fans out into many subagents over a shared context, with the loop itself executing on Impala rather than in your application. ## Why run the swarm here **Prefix reuse across siblings.** Subagents spawned from one parent share a large prompt prefix — system prompt, tool schemas, the parent's accumulated context. When the loop runs next to the fleet, that KV state is already resident rather than being re-sent and recomputed per child. This is the mechanism described in [Impala Herd](/impala-herd), applied to fan-out. **Swarm state survives capacity changes.** A long-running swarm outlives the machines it starts on. Impala holds the execution state — the parent context, the subagents in flight, what has already completed — so a run continues across scaling events and instance changes in your cloud instead of starting over. **Cost per completed task, not per call.** A swarm is the clearest case of the argument in [Run async and open source](/async-inference): nobody is reading the intermediate tokens, dozens of children are in flight, and the only number that matters is what the finished task cost. ## Where it runs Swarm runs in [Bring your own cloud](/getting-started-infrastructure-setup) deployments, so the swarm's state and every intermediate result stay inside your own VPC and buckets — see [Security & data handling](/security). ## Need help? Reach out to your Impala contact directly. # Video Source: https://docs.getimpala.ai/video-input Send video to vision-language models in batch chat-completion requests. Vision-language models on Impala accept video as input. Send it as a reference to an object in S3, or inline as base64. The request format is the same as vLLM's video input. The inference engine splits the video into frames and encodes them with the prompt. You can set the frame rate per request with `mm_processor_kwargs`: ```json theme={null} {"mm_processor_kwargs": {"fps": 2}} ``` For S3 access requirements, see [Images](/pass_images_with_image_url#s3-access). The same bucket setup applies. # Impala Leap Source: https://docs.getimpala.ai/weight-sync Impala Leap swaps model weights in seconds, with no redeploy. Upload a checkpoint, reload it, and the running fleet serves it. **Impala Leap** changes the weights a running deployment serves, in seconds, without a redeploy. You upload a checkpoint, trigger a reload, and the fleet starts serving the new weights on the same endpoint, through the same engine ([Impala Herd](/impala-herd)). Use Leap when you retrain or fine-tune on your own cadence and need the serving fleet to follow — RL loops, post-training iteration, or any workflow where new weights ship more often than new infrastructure. ## Endpoints Impala splits inference from management. Inference runs on the OpenAI-compatible surface; Leap is an Impala-specific operation and lives under `/imp/v1`. | Method | Path | Purpose | | - | - | - | | `POST` | `/imp/v1/weights/upload` | Stage a checkpoint from your S3 bucket | | `POST` | `/imp/v1/weights/reload` | Swap the staged checkpoint onto the fleet | | `GET` | `/imp/v1/weights/status` | Current state of the sync | Base URL: `https://inference.getimpala.ai`. The OpenAI-compatible endpoints sit alongside at `/open-ai/v1/`. Authentication is the same bearer token you use for inference. ## How a sync progresses ![Weight sync API state machine: Ready, POST /upload to Uploading weights, POST /reload to Reloading weights, then new weights live and back to Ready. GET /status is readable throughout.](https://mintcdn.com/impalaai/D6PXSk0MrZyYwOiY/weight-sync-api.png?fit=max\&auto=format\&n=D6PXSk0MrZyYwOiY\&q=85\&s=3bfaa91301c9bed68402df43f2db3bb4) `GET /imp/v1/weights/status` is valid at any point and reports which state the fleet is in. **Ready** — serving current weights, nothing in flight. **Uploading weights** — the checkpoint is transferring from your bucket. Serving continues on the old weights. **Reloading weights** — engines are swapping to the new checkpoint. **Back to Ready** — the new weights are live. Upload is the long step and scales with checkpoint size and available bandwidth. The reload itself is fast by comparison. ## Uploading a checkpoint Both `upload` and `reload` take a map of model identifier to S3 URI, so a fleet serving more than one model can be updated per model. ```bash theme={null} curl -X POST https://inference.getimpala.ai/imp/v1/weights/upload \ -H "Authorization: Bearer $IMPALA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "weights": { "": "s3://your-bucket/checkpoints/2026-08-20/" } }' ``` Poll until the upload completes: ```bash theme={null} curl https://inference.getimpala.ai/imp/v1/weights/status \ -H "Authorization: Bearer $IMPALA_API_KEY" ``` ## Reloading ```bash theme={null} curl -X POST https://inference.getimpala.ai/imp/v1/weights/reload \ -H "Authorization: Bearer $IMPALA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "weights": { "": "s3://your-bucket/checkpoints/2026-08-20/" } }' ``` Poll `/status` until the fleet returns to `Ready`, then send a test request through your normal inference endpoint to confirm the new weights are answering. ## Things to know **The checkpoint has to be loadable onto the running engines.** A checkpoint whose architecture or quantization differs from what the fleet is serving cannot be hot-swapped; it needs a new deployment. Impala validates this from the checkpoint's `safetensors` metadata before reloading. **Failed steps retry automatically**, up to three attempts, before the sync is reported as failed. **Give Impala read access to the bucket** holding your checkpoints before your first sync. ## Need help? Reach out to your Impala contact directly.