inferno-ai 0.10.3

Enterprise AI/ML model runner with automatic updates, real-time monitoring, and multi-interface support
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
# 📦 Package Manager Tutorial

Master Inferno's revolutionary package manager - install, manage, and optimize AI models like software packages with apt/yum-style commands.

## Overview

Inferno's package manager transforms AI model management from a complex, manual process into something as simple as installing software. This tutorial covers:

- ✅ **Installing models** from multiple repositories
- ✅ **Searching and discovering** models across 500K+ options
- ✅ **Managing repositories** and custom sources
- ✅ **Upgrading and maintaining** model installations
- ✅ **Advanced features** like auto-updates and dependencies

**Time Required**: 15-20 minutes
**Skill Level**: Beginner to Intermediate

## Why Use the Package Manager?

Traditional AI model management is painful:
- Manual downloads from various sources
- Complex installation procedures
- No dependency management
- No version control or updates
- Inconsistent model formats

Inferno's package manager solves all of this:
- One command installs any model
- Automatic format conversion and optimization
- Dependency resolution and conflict detection
- Seamless updates and rollbacks
- Unified interface across all repositories

## Quick Start

```bash
# Install a popular conversational model
inferno install microsoft/DialoGPT-medium

# Start using it immediately
inferno run --model DialoGPT-medium --prompt "Hello!"

# That's it! 🎉
```

## Repository System

Inferno comes pre-configured with major AI model repositories:

### Pre-configured Repositories

| Repository | Models | Specialty | Size |
|------------|--------|-----------|------|
| **🤗 Hugging Face** | 500K+ | General AI, NLP, Vision, Audio | Largest |
| **🦙 Ollama** | 100+ | Optimized for local inference | Fast |
| **📊 ONNX Model Zoo** | 200+ | Computer vision, official models | Reliable |
| **🔥 PyTorch Hub** | 1000+ | Research models, cutting-edge | Advanced |
| **🧠 TensorFlow Hub** | 4000+ | Production models, Google | Stable |

### Repository Management

```bash
# List configured repositories
inferno repo list

# Add custom repository
inferno repo add company-models https://models.company.com

# Add with authentication
inferno repo add private-repo https://private.models.com \
  --username admin --password secret

# Set repository priority
inferno repo add enterprise https://enterprise.models.com --priority 1

# Update repository metadata
inferno repo update
inferno repo update huggingface  # Update specific repo

# Enable/disable repositories
inferno repo disable pytorch-hub
inferno repo enable pytorch-hub
```

## Model Discovery and Search

### Basic Search

```bash
# Search all repositories
inferno search "language model"
inferno search "gpt"
inferno search "bert"

# Search with filters
inferno search "vision model" --category computer-vision
inferno search "embedding" --size small
inferno search "llama" --license apache
```

### Advanced Search

```bash
# Repository-specific search
inferno search "code generation" --repo huggingface
inferno search "optimization" --repo onnx

# Category filtering
inferno search "model" --category nlp
inferno search "model" --category computer-vision
inferno search "model" --category audio
inferno search "model" --category multimodal

# Size filtering
inferno search "language model" --size small     # < 1GB
inferno search "language model" --size medium    # 1-10GB
inferno search "language model" --size large     # 10-50GB
inferno search "language model" --size xlarge    # > 50GB

# Sort results
inferno search "gpt" --sort downloads     # Most popular
inferno search "bert" --sort recent       # Most recent
inferno search "llama" --sort stars       # Most starred

# Limit results
inferno search "transformer" --limit 20
```

### Search Output Formats

```bash
# Table format (default)
inferno search "gpt2"

# Compact format
inferno search "gpt2" --format compact

# JSON format for scripting
inferno search "gpt2" --format json | jq '.[0].name'

# Detailed information
inferno search "gpt2" --detailed
```

## Model Installation

### Basic Installation

```bash
# Install from default repository (Hugging Face)
inferno install microsoft/DialoGPT-medium
inferno install gpt2
inferno install bert-base-uncased

# Install from specific repository
inferno install llama2:7b --repo ollama
inferno install resnet50 --repo onnx
inferno install gpt-neo-1.3B --repo pytorch-hub
```

### Installation Options

```bash
# Install with automatic updates
inferno install mistralai/Mistral-7B-v0.1 --auto-update

# Install with specific quantization
inferno install llama-2-7b-chat --quantization q4_0
inferno install code-llama-7b --quantization q8_0

# Force reinstallation
inferno install gpt2 --force

# Install without using cache
inferno install large-model --no-cache

# Verify checksums during installation
inferno install critical-model --verify
```

### Installation Examples by Use Case

#### Conversational AI

```bash
# Small, fast chat models
inferno install microsoft/DialoGPT-small      # 117MB, quick responses
inferno install distilgpt2                    # 82MB, very fast

# High-quality conversation
inferno install microsoft/DialoGPT-large      # 776MB, excellent quality
inferno install facebook/blenderbot-400M-distill  # 400MB, engaging chat

# Instruction-following models
inferno install microsoft/DialoGPT-medium     # 345MB, balanced
inferno install togethercomputer/RedPajama-INCITE-Chat-3B-v1  # 3GB, powerful
```

#### Code Generation

```bash
# Code completion and generation
inferno install microsoft/codebert-base       # 500MB, code understanding
inferno install salesforce/codegen-350M-mono  # 350MB, fast code gen
inferno install codellama/CodeLlama-7b-Instruct  # 3.8GB, advanced coding

# Specialized code models
inferno install microsoft/codebert-base-mlm    # 500MB, masked language modeling
inferno install huggingface/CodeBERTa-small-v1  # 84MB, compact code model
```

#### Text Analysis and Embeddings

```bash
# Sentence embeddings
inferno install sentence-transformers/all-MiniLM-L6-v2  # 90MB, fast embeddings
inferno install sentence-transformers/all-mpnet-base-v2  # 420MB, high quality

# Text classification
inferno install cardiffnlp/twitter-roberta-base-sentiment  # 500MB, sentiment
inferno install facebook/bart-large-mnli       # 1.6GB, natural language inference

# Named entity recognition
inferno install dbmdz/bert-large-cased-finetuned-conll03-english  # 1.3GB, NER
```

#### Multilingual Models

```bash
# Multilingual conversation
inferno install microsoft/DialoGPT-medium     # English, but works with other languages
inferno install facebook/mbart-large-50-many-to-many-mmt  # 2.3GB, 50 languages

# Multilingual embeddings
inferno install sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2  # 470MB
inferno install sentence-transformers/distiluse-base-multilingual-cased  # 540MB
```

## Model Management

### Listing Installed Models

```bash
# List all installed models
inferno list

# Detailed listing with metadata
inferno list --detailed

# Show file sizes and disk usage
inferno list --size

# Show usage statistics
inferno list --usage

# Filter by category
inferno list --category nlp
inferno list --category computer-vision

# Show only unused models
inferno list --unused

# Show models with available updates
inferno list --outdated
```

### Model Information

```bash
# Get detailed model information
inferno package info microsoft/DialoGPT-medium

# Show installation details
inferno package info gpt2 --installation

# Show usage statistics
inferno package info bert-base --usage

# Show dependencies
inferno package info complex-model --dependencies
```

### Model Removal

```bash
# Remove single model
inferno remove microsoft/DialoGPT-small

# Remove multiple models
inferno remove old-model1 old-model2 old-model3

# Remove with confirmation prompts
inferno remove dangerous-model --interactive

# Force removal without confirmation
inferno remove test-model --force

# Remove only cache, keep model
inferno remove cached-model --cache-only

# Complete removal including all traces
inferno remove experimental-model --purge

# Remove all unused models
inferno remove --unused

# Dry run - show what would be removed
inferno remove old-models --dry-run
```

## Package Updates and Maintenance

### Updating Models

```bash
# Update all models
inferno package upgrade

# Update specific model
inferno package upgrade microsoft/DialoGPT-medium

# Check for available updates
inferno package list-upgrades

# Update with confirmation
inferno package upgrade --interactive

# Force update even if version is same
inferno package upgrade gpt2 --force
```

### Automatic Updates

```bash
# Enable auto-updates for specific model
inferno package config microsoft/DialoGPT-medium --auto-update

# Disable auto-updates
inferno package config gpt2 --no-auto-update

# Set update schedule (daily, weekly, monthly)
inferno package config llama-2-7b --auto-update --schedule weekly

# Check auto-update status
inferno package config --list-auto-updates
```

### Package Database Maintenance

```bash
# Update repository metadata
inferno repo update

# Repair package database
inferno package repair

# Clean package cache
inferno package clean

# Verify package integrity
inferno package verify --all

# Rebuild package database
inferno package rebuild-db
```

## Advanced Features

### Dependency Management

```bash
# Install with dependencies
inferno install complex-model --include-dependencies

# Show dependency tree
inferno package dependencies microsoft/DialoGPT-medium

# Check for dependency conflicts
inferno package check-conflicts

# Resolve conflicts automatically
inferno package resolve-conflicts --auto
```

### Version Management

```bash
# Install specific version
inferno install gpt2@v1.0.0

# List available versions
inferno package versions gpt2

# Pin to specific version (no auto-updates)
inferno package pin gpt2@v1.0.0

# Unpin version
inferno package unpin gpt2

# Rollback to previous version
inferno package rollback gpt2
```

### Model Variants and Quantization

```bash
# List available variants
inferno package variants llama-2-7b

# Install specific quantization
inferno install llama-2-7b-chat-q4_0    # 4-bit quantization
inferno install llama-2-7b-chat-q8_0    # 8-bit quantization
inferno install llama-2-7b-chat-f16     # 16-bit float

# Install with automatic quantization
inferno install large-model --auto-quantize

# Compare quantization performance
inferno bench llama-2-7b-f16
inferno bench llama-2-7b-q4_0
```

### Batch Operations

```bash
# Install multiple models from file
cat > models.txt << EOF
microsoft/DialoGPT-medium
microsoft/codebert-base
sentence-transformers/all-MiniLM-L6-v2
EOF

inferno install --batch models.txt

# Install models by pattern
inferno install "microsoft/*" --pattern

# Export installed models list
inferno list --format json > installed_models.json

# Install from exported list
inferno install --from-file installed_models.json
```

## Custom Repositories

### Setting Up Private Repositories

```bash
# Add private repository with authentication
inferno repo add company-models https://models.company.com \
  --username admin \
  --password secret \
  --verify-ssl false

# Add with API token
inferno repo add private-hub https://private.hub.com \
  --token your-api-token

# Add with priority (higher number = higher priority)
inferno repo add enterprise https://enterprise.models.com --priority 10
```

### Repository Configuration

```bash
# List repository details
inferno repo list --detailed

# Configure repository settings
inferno repo config company-models --timeout 300
inferno repo config company-models --retry-count 3
inferno repo config company-models --mirror https://mirror.company.com

# Test repository connectivity
inferno repo test company-models

# Enable/disable repository verification
inferno repo config company-models --verify-checksums true
```

### Creating a Repository Index

For hosting your own repository:

```yaml
# models.yaml - Repository index format
models:
  - name: "company/custom-gpt"
    version: "1.0.0"
    description: "Custom GPT model for company use"
    size: 2400000000
    format: "gguf"
    checksum: "sha256:abcdef123456..."
    download_url: "https://models.company.com/custom-gpt-v1.gguf"
    dependencies:
      - "tokenizer-base"
    metadata:
      category: "nlp"
      license: "proprietary"
      authors: ["Company AI Team"]
```

## Performance and Optimization

### Cache Management

```bash
# Check cache status
inferno cache status

# Warm cache with popular models
inferno cache warm --popular

# Pre-load specific models
inferno cache warm microsoft/DialoGPT-medium gpt2

# Clear cache for specific model
inferno cache clear --model gpt2

# Optimize cache storage
inferno cache optimize
```

### Download Optimization

```bash
# Use multiple connections for faster downloads
inferno install large-model --parallel 8

# Resume interrupted downloads
inferno install large-model --resume

# Use specific mirror
inferno install gpt2 --mirror https://mirror.huggingface.co

# Limit download bandwidth
inferno install large-model --limit-rate 10M
```

### Storage Management

```bash
# Check disk usage
inferno package disk-usage

# Find largest models
inferno list --size --sort size

# Compress models to save space
inferno package compress old-models

# Move models to different location
inferno package relocate --models-dir /new/location
```

## Integration with Development Workflow

### CI/CD Integration

```bash
#!/bin/bash
# ci-install-models.sh

# Install required models for testing
models=(
    "microsoft/DialoGPT-small"
    "sentence-transformers/all-MiniLM-L6-v2"
    "gpt2"
)

for model in "${models[@]}"; do
    echo "Installing $model..."
    inferno install "$model" --no-cache --verify
done

# Verify installations
inferno list --format json > installed_models.json
```

### Docker Integration

```dockerfile
FROM inferno:latest

# Install models during image build
RUN inferno install microsoft/DialoGPT-medium --no-cache
RUN inferno install gpt2 --no-cache

# Warm cache
RUN inferno cache warm --all

EXPOSE 8080
CMD ["inferno", "serve"]
```

### Configuration Management

```toml
# inferno.toml - Model configuration
[packages]
auto_update = true
update_schedule = "weekly"
verify_checksums = true

[repositories]
default_timeout = 300
max_parallel_downloads = 4
use_mirrors = true

[cache]
max_size_gb = 50
compression = "zstd"
```

## Troubleshooting

### Common Issues

#### Download Failures

```bash
# Check network connectivity
ping huggingface.co

# Retry with verbose output
inferno install model-name --verbose --retry

# Use different repository
inferno install model-name --repo ollama

# Check repository status
inferno repo test huggingface
```

#### Storage Issues

```bash
# Check available space
df -h $(inferno config get models_dir)

# Clean up unused models
inferno remove --unused

# Clear cache
inferno cache clear

# Compress models
inferno package compress --all
```

#### Authentication Issues

```bash
# Check repository authentication
inferno repo list --auth-status

# Re-authenticate
inferno repo auth huggingface --token new-token

# Test authentication
inferno repo test private-repo
```

#### Dependency Conflicts

```bash
# Check for conflicts
inferno package check-conflicts

# Resolve automatically
inferno package resolve-conflicts --auto

# Manual resolution
inferno package dependencies --tree
inferno remove conflicting-model
```

### Debug Mode

```bash
# Enable debug logging
export INFERNO_LOG_LEVEL=debug

# Verbose package operations
inferno install model-name --verbose

# Trace package operations
inferno --trace install model-name
```

## Best Practices

### Model Selection

1. **Start Small**: Begin with compact models for testing
2. **Match Use Case**: Choose models optimized for your task
3. **Consider Resources**: Select models that fit your hardware
4. **Test Quantization**: Try quantized models for better performance

### Repository Management

1. **Use Priorities**: Set repository priorities based on trust
2. **Regular Updates**: Keep repository metadata up to date
3. **Monitor Size**: Track repository and model sizes
4. **Backup Lists**: Export model lists for disaster recovery

### Maintenance

1. **Regular Cleanup**: Remove unused models periodically
2. **Monitor Updates**: Keep models updated for improvements
3. **Check Health**: Verify model integrity regularly
4. **Optimize Cache**: Manage cache size and compression

## Next Steps

Now that you've mastered the package manager, explore these advanced topics:

### Immediate Next Steps
1. **[Performance Optimization]performance-optimization.md** - Optimize installed models
2. **[Model Management]model-management.md** - Advanced model operations
3. **[Custom Backend Development]custom-backend.md** - Support new model formats

### Production Topics
1. **[Security Configuration]../guides/security.md** - Secure package management
2. **[Monitoring Setup]../guides/monitoring.md** - Monitor package operations
3. **[Backup and Recovery]../guides/backup-recovery.md** - Protect your model investments

---

**🎉 Congratulations!** You now have complete mastery over Inferno's package manager. You can discover, install, and manage AI models with the same ease as installing software packages. The entire AI model ecosystem is now at your fingertips!