Getting Started
Get up and running with Pulse in under 5 minutes.
Installation
Install the Pulse CLI globally using npm (official package: @digelim/pulse):
npm install -g @digelim/pulseOr using pnpm:
pnpm add -g @digelim/pulseNote: The package is published on npm as @digelim/pulse. Use this name in all install and import commands.
Initialize a Project
Create a new Pulse project with the init command:
pulse init my-ml-project
cd my-ml-projectThis creates a new directory with the following structure:
my-ml-project/
├── pulse.yaml # Main configuration
├── models/
│ └── example.model.yaml
├── datasources/
│ └── default.datasource.yaml
└── .pulse/
└── cache/Define Your First Model
Create a model definition in models/fraud-detector.model.yaml:
model: fraud-detector
version: "1.0.0"
runtime: python3.11
input:
type: object
properties:
transaction_amount:
type: number
merchant_category:
type: string
user_history:
type: array
items:
type: object
output:
type: object
properties:
is_fraud:
type: boolean
confidence:
type: number
minimum: 0
maximum: 1
training:
datasource: transactions-db
snapshot: required
schedule: "0 2 * * *" # Daily at 2 AM
inference:
timeout: 100ms
retries: 3
cache:
ttl: 60s
key: [user_id, merchant_category]Configure a Datasource
Define your data source in datasources/transactions-db.datasource.yaml:
datasource: transactions-db
type: postgresql
connection:
host: ${POSTGRES_HOST}
port: 5432
database: transactions
ssl: required
schema:
table: transactions
columns:
- name: id
type: uuid
primary: true
- name: amount
type: decimal
- name: merchant_category
type: string
- name: is_fraud
type: boolean
- name: created_at
type: timestamp
snapshot:
strategy: incremental
column: created_at
retention: 90dValidate Your Configuration
Run the validate command to ensure your configuration is correct:
pulse validate
✓ Configuration valid
✓ Model schema: fraud-detector (1.0.0)
✓ Datasource: transactions-db (postgresql)
✓ Snapshot strategy: incrementalTrain Your Model
Trigger a training run with automatic snapshot creation:
pulse train fraud-detector
→ Creating snapshot: transactions-db@2024-01-15T10:30:00Z
→ Snapshot created: snap_abc123
→ Training started: run_xyz789
→ Model artifact: fraud-detector@1.0.0-abc123
✓ Training complete in 4m 32sDeploy and Infer
Deploy your model and run inference:
pulse deploy fraud-detector
✓ Deployed: fraud-detector@1.0.0-abc123
→ Endpoint: https://api.pulse.dev/v1/infer/fraud-detectorMake inference requests:
curl -X POST https://api.pulse.dev/v1/infer/fraud-detector \
-H "Authorization: Bearer $PULSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction_amount": 1500.00,
"merchant_category": "electronics",
"user_history": []
}'Next Steps
- Learn about the architecture - Understand how Pulse modules work together
- Explore the protocol - Deep dive into model and datasource contracts
- Configure datasources - Connect to your data infrastructure
- View examples - Real-world use cases and patterns