Upgrade to Pro — share decks privately, control downloads, hide ads and more …

When AI Becomes a Library — The Nolife Local Ex...

When AI Becomes a Library — The Nolife Local Experiment

A Darkwood experiment with Depth Anything 3, a local native runtime, Symfony, PHP FFI and Darkwood Flow. The presentation follows inference ownership, observability, a double-inference bug and the limits of the measured performance results.

Canonical interactive presentation: https://slides.darkwood.com/slides/nolife-local

Avatar for Mathieu Ledru

Mathieu Ledru

November 08, 2026

More Decks by Mathieu Ledru

Other Decks in Programming

Transcript

  1. Darkwood · Symfony · PHP FFI · Flow When AI

    Becomes a Library The Nolife Local Experiment Depth Anything 3 + Symfony + PHP FFI + Darkwood Flow @matyo91
  2. Slide 2 · 1/2 · représentation statique The default reflex

    We use LLMs for everything. ↓ ↓ ↓ 02 | reflex Version interactive : https://slides.darkwood.com/slides/nolife-local problem large model prompt @matyo91
  3. Slide 2 · 2/2 · représentation statique The default reflex

    We use LLMs for everything. text 02 | reflex Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  4. Slide 3 · 1/1 · représentation statique The question What

    if the task already has a specialized model? ↓ ↓ problem specialized model structured computation 03 | question Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  5. Depth is not language DEPTH ANY THING 3 GENERAL LLM

    "The mountains are far away." 504 × 280 depth values relative units · not meters 04 | depth @matyo91
  6. Slide 5 · 1/2 · représentation statique Depth Anything 3

    ↓ ↓ RGB image Depth Anything 3 depth confidence camera 3D / GLB 05 | da3 Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  7. Slide 5 · 2/2 · représentation statique DA3-BASE · relative

    depth · not meters 05 | da3 Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  8. Research Slide 6 · 1/2 · représentation statique → runtime

    ↓ ↓ ↓ PyTorch checkpoint GGUF ggml Metal 06 | runtime Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  9. Slide 6 · 2/2 · représentation statique ↓ Depth ·

    Camera · GLB 06 | runtime Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  10. What “specialized” means NOT THIS PROJECT THIS PROJECT fine-tuning purpose-trained

    model LoRA local native runtime training from scratch quantized representation 07 | specialized @matyo91
  11. Slide 8 · 1/1 · représentation statique The unusual constraint

    No Python service. No cloud AI API. ↓ ↓ Symfony PHP FFI native model 08 | php Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  12. Slide 9 · 1/1 · représentation statique Architecture Symfony hosts

    the boundary. Browser Symfony Darkwood Flow NativeDepthBridge PHP FFI libdepthanything ggml / Metal Depth Anything 3 09 | architecture Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  13. Ownership PHP OWNS NATIVE OWNS HTTP · validation · Flow

    orchestration · GD colormap Twig · CLI · observability ViT · DPT · depth confidence · camera Metal · GLB export PHP does not perform matrix multiplication. 10 | ownership @matyo91
  14. Slide 11 · 1/2 · représentation statique PHP FFI $ffi->da_capi_depth_dense(

    $ctx, $imagePath, … ); ↓ ↓ 11 | ffi Version interactive : https://slides.darkwood.com/slides/nolife-local native pointer PHP array @matyo91
  15. Slide 11 · 2/2 · représentation statique da_capi_free_floats 11 |

    ffi Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  16. Slide 12 · 1/2 · représentation statique Application pipeline Upload

    ↓ ↓ Validate → Infer → Colormap GLB 12 | pipeline Version interactive : https://slides.darkwood.com/slides/nolife-local → Result @matyo91
  17. Slide 12 · 2/2 · représentation statique Darkwood Flow ·

    explicit steps · per-step timings 12 | pipeline Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  18. Slide 14 · 1/2 · représentation statique The benchmark that

    did not make sense Capture statique : Schéma ou tableau Lecture du schéma : STEP MS Validate ~3 InferDepth ~2639 Colormap ~86 14 | anomaly Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  19. Slide 14 · 2/2 · représentation statique ExportScene ~2535 Total

    ~5260 Why is ExportScene another 2.5 seconds? 14 | anomaly Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  20. Before The hidden second inference image ├── inference → depth

    └── inference → GLB 15 | double pass da_capi_depth_dense da_capi_export_glb depth_pose_native() × 2 → @matyo91
  21. After One inference, several outputs image ↓ one inference ↓

    native result ├── depth ├── confidence ├── camera └── GLB da_capi_export_glb_cached · ABI v11 16 | fix @matyo91
  22. Measured impact ~5.26 s 2 native inferences ~3.27 s 1

    native inference · GLB ~19 ms 504×336 · q4_k · warm · Apple M4 / Metal 17 | impact @matyo91
  23. Slide 18 · 1/1 · représentation statique Measurement discipline Different

    tensor size ≠ regression Capture statique : Schéma ou tableau Lecture du schéma : SOURCE PROCESSED INFER MEDIAN 1280×720 504×280 ~2495 ms 1024×680 504×336 ~3.0–3.2 s Compare processed resolution — not headline numbers alone. 18 | resolution Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  24. Quantization 4× smaller. Not 4× faster. q4_k ~99 MB ·

    ~2495 ms f32 ~393 MB · ~2495 ms Warm infer-only · 504×280 · Apple M4 / Metal 19 | quant @matyo91
  25. Slide 20 · 1/2 · représentation statique Local means local

    No remote AI inference No cloud API at runtime GGUF on disk · Metal on device Demo runtime works with networking disabled 20 | local Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  26. Slide 20 · 2/2 · représentation statique 20 | local

    Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  27. AI becomes infrastructure The model starts to look like a

    dependency. php bin/console app:depth-check php bin/console app:depth-bench php bin/console app:depth-stress php bin/console app:depth-cleanup Flow / PHP overhead ~114 ms · infer dominates 21 | infra @matyo91
  28. Development loop EARLY L ATER idea observe → evidence →

    ask agent → issue → agent → inspect → implement → measure 22 | loop @matyo91
  29. Slide 23 · 1/2 · représentation statique Issue-first The valuable

    part was the problem definition. Observation: Two native inference passes. Evidence: Infer ≈ 2.6 s · GLB ≈ 2.5 s Constraint: One inference per request. Expected: 23 | issue Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  30. Slide 23 · 2/2 · représentation statique Issue-first The valuable

    part was the problem definition. Reuse native dense result. Non-goal: No Messenger / concurrency layer. 23 | issue Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  31. Synthesis Reduce unnecessary generality. RUNTIME general model DEVELOPMENT general prompt

    ↓ ↓ specialized model well-defined issue 24 | synthesis @matyo91
  32. What I learned PHP FFI was enough Native infer dominates

    cost Observability found the real bug q4_k saved size, not latency here Context > code volume Evidence beats speculation 25 | learned @matyo91
  33. Slide 26 · 1/2 · représentation statique Conclusion The task

    should determine the model, the architecture, and the prompt. ↓ ↓ Depth Anything 3 · specialized computation Darkwood Flow · observable pipeline 26 | conclusion Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91
  34. Slide 26 · 2/2 · représentation statique Conclusion The task

    should determine the model, the architecture, and the prompt. Issue-first brief · specialized context 26 | conclusion Version interactive : https://slides.darkwood.com/slides/nolife-local @matyo91