Usage Examples
// Agent code
const pact = new PactClient({ apiKey });
// Deploy Serverless function
const func = await pact.compute.deployFunction({
name: 'daily-report',
runtime: 'python3.11',
code: reportGenerator,
schedule: '0 9 * * *', // 9am daily
paymentToken: 'USDC'
});
// Auto-billed execution, no manual intervention// Rent GPU instance
const gpu = await pact.compute.rentGPU({
type: 'A100',
duration: 4, // hours
paymentToken: 'USDC', // Price stable
image: 'pytorch/pytorch:2.0'
});
// Upload data and start training
await gpu.uploadData('s3://my-dataset');
await gpu.execute('python train.py');Last updated