> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Lazy Imports CLI

> CLI commands for verifying lazy import behavior

# Lazy Imports CLI

Commands for verifying and testing lazy import behavior in PraisonAI Agents.

## Commands

### Check Lazy Imports

Verify that heavy dependencies are not loaded at import time:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai perf lazy-check
```

**Output:**

```
Lazy Import Check:
  litellm: LAZY (good)
  chromadb: LAZY (good)
  mem0: LAZY (good)
  requests: LAZY (good)
```

### Measure Import Time

Measure the import time of praisonaiagents:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai perf import-time
```

**Output:**

```
Import time: 18.4ms (median)
Target: <200ms
Status: PASS
```

### Full Performance Benchmark

Run a complete performance benchmark including lazy import checks:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai perf benchmark
```

**Output:**

```
============================================================
PraisonAI Agents Performance Benchmark
============================================================

[1/3] Measuring import time...
      Median: 18.4ms [PASS]

[2/3] Measuring memory usage...
      Current: 33.0MB [WARN]

[3/3] Checking lazy imports...
      All lazy: True [PASS]
        ✓ litellm
        ✓ chromadb
        ✓ mem0
        ✓ requests

============================================================
Overall: [PASS]
============================================================
```

## Performance Targets

| Metric       | Target          | Hard Fail          |
| ------------ | --------------- | ------------------ |
| Import Time  | less than 200ms | greater than 300ms |
| Memory Usage | less than 30MB  | greater than 45MB  |
| Lazy Imports | All lazy        | Any eager          |

## Environment Variables

Control lazy import behavior:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Check current configuration
python -c "from praisonaiagents._config import LAZY_IMPORTS; print(LAZY_IMPORTS)"
```

## CI/CD Integration

Use the check command in CI pipelines:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Returns exit code 0 on pass, 1 on fail
praisonai perf check

# Use in CI
if praisonai perf check; then
    echo "Performance check passed"
else
    echo "Performance regression detected"
    exit 1
fi
```

## Related

* [Lazy Imports (Code)](/docs/features/lazy-imports)
* [Performance Benchmarks](/docs/features/performance-benchmarks)
* [Performance CLI](/docs/cli/performance)
