Skip to content

DLStreamer coding agent (draft implementation for validation purposes).#741

Merged
tjanczak merged 13 commits intomainfrom
dlstreamer_coding_agent
Apr 9, 2026
Merged

DLStreamer coding agent (draft implementation for validation purposes).#741
tjanczak merged 13 commits intomainfrom
dlstreamer_coding_agent

Conversation

@tjanczak
Copy link
Copy Markdown
Contributor

@tjanczak tjanczak commented Apr 1, 2026

Description

Instructions for AI Coding Agents on how to generate new Python sample apps.
Work in progress - PR submitted for validation purposes on 'clean machines'.

Fixes # (issue)

Any Newly Introduced Dependencies

No new dependencies.

How Has This Been Tested?

Experimental feature, work in progress.

Checklist:

  • I agree to use the MIT license for my code changes.
  • I have not introduced any 3rd party components incompatible with MIT.
  • I have not included any company confidential information, trade secret, password or security token.
  • I have performed a self-review of my code.

@qianlongding
Copy link
Copy Markdown
Contributor

I’m thrilled about the new development direction for DLStreamer: creating skills for AI agents to invoke.
Instead of providing samples to user, invoking the skills through AI agents, we will significantly help user to accelerate the process of generating custom pipelines tailored to their specific business scenarios by typing nature language.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a draft “DLStreamer coding agent” skill package intended to guide AI coding agents in generating new DLStreamer Python sample apps from natural-language pipeline descriptions.

Changes:

  • Introduces the dlstreamer-coding-agent skill definition (SKILL.md) with usage guidance, reference samples, and a generation procedure.
  • Adds reference documentation for pipeline construction, model preparation, design patterns, and coding conventions.
  • Adds reusable assets/templates for generated sample app READMEs and Python/model-export scripts.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
.github/skills/dlstreamer-coding-agent/SKILL.md Defines when/how to use the skill and a recommended sample-app layout/procedure.
.github/skills/dlstreamer-coding-agent/references/pipeline-construction.md Reference for elements, patterns, and rules for building pipelines/apps.
.github/skills/dlstreamer-coding-agent/references/model-preparation.md Guidance for downloading/exporting models from common ecosystems to OV IR.
.github/skills/dlstreamer-coding-agent/references/design-patterns.md Catalog of reusable implementation patterns mapped to existing samples.
.github/skills/dlstreamer-coding-agent/references/coding-conventions.md Conventions for headers/imports/plugins/errors/metadata access.
.github/skills/dlstreamer-coding-agent/assets/README-template.md README scaffold for generated samples.
.github/skills/dlstreamer-coding-agent/assets/python-app-template.py Starter Python app template (pipeline + IO + event loop).
.github/skills/dlstreamer-coding-agent/assets/export-models-template.py Starter model download/export script template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tbujewsk
tbujewsk previously approved these changes Apr 8, 2026
@tjanczak
Copy link
Copy Markdown
Contributor Author

tjanczak commented Apr 8, 2026

I’m thrilled about the new development direction for DLStreamer: creating skills for AI agents to invoke. Instead of providing samples to user, invoking the skills through AI agents, we will significantly help user to accelerate the process of generating custom pipelines tailored to their specific business scenarios by typing nature language.

Feel free to contribute and improve!
I think we need some 'minimum set' of samples for AI Coding Agents to learn from, but indeed we cannot generate samples endlessly - the way to scale is to use AI Coding Agents.

Copilot AI review requested due to automatic review settings April 8, 2026 13:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@qianlongding qianlongding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Harness Documentation: To make this user-friendly, should we provide a brief README or guide on how to integrate these skills with popular AI harnesses (e.g., Claude Code, OpenCode, or Open Codex)? This would help users understand exactly how to 'plug' our skills into their existing AI agent workflows

@tjanczak
Copy link
Copy Markdown
Contributor Author

tjanczak commented Apr 9, 2026

AI Harness Documentation: To make this user-friendly, should we provide a brief README or guide on how to integrate these skills with popular AI harnesses (e.g., Claude Code, OpenCode, or Open Codex)? This would help users understand exactly how to 'plug' our skills into their existing AI agent workflows

Yes, this is by no means 'complete' - it is still an early version; the goal is to have it hardened and released to external custoemers as part of OEP 2026.1.

@tjanczak tjanczak merged commit d37cef0 into main Apr 9, 2026
39 checks passed
@tjanczak tjanczak deleted the dlstreamer_coding_agent branch April 9, 2026 08:18

## Procedure

### Quick Recipes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pattern ids in the table below , like 1 + 4 + 11 require the reader to cross-reference design-patterns.md to understand what they mean.

so i suggest inlining the names to make the table self-contained, e.g.:
1 (pipeline core) + 4 (ai inference) + 11 (file output)

this also reduces the risk of the agent misreading the recipe if pattern numbering ever shifts.


Map the user's description to one or more of these patterns:

| Pattern | When to Apply |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this table lists patterns by name only, while the quick recipes above reference them by number only. an agent reasoning top-to-bottom through this file sees numbers first, then names, with no explicit link between them. adding the pattern numbers as a column here (or as a prefix in the pattern name column) would close that gap.

--device /dev/dri \
--group-add $(stat -c "%g" /dev/dri/render*) \
--device /dev/accel \
--group-add $(stat -c "%g" /dev/accel/accel*) \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stat -c "%g" /dev/accel/accel* will fail on systems without an npu because the glob expands to nothing. please maybe wrap the --device /dev/accel and --group-add lines in a conditional, or at minimum add a note that these lines should only be included when npu devices are present on the host.


# GPU fallback
device = args.device
if device == "GPU" and not os.path.exists("/dev/dri/renderD128"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the gpu detection relies on /dev/dri/renderD128 which is the first intel igpu render node on linux. this could manifest as a silent callback to cpu on systems where the render node is renderD129 or higher (like, discrete gpu), and it won't work at all on windows. a more portable approach would be to query openvino directly, like "GPU" in Core().available_devices

as i was typing this, i remembered @pbartosik found a way to do this in an even better way in Optimizer.


```python
det_dev = args.device
if det_dev == "GPU" and not os.path.exists("/dev/dri/renderD128"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same issue as in the python-app-template

same issue as in the app template: the recommended gpu check is hardcoded to /dev/dri/renderD128. since this is the canonical convention document that all generated apps will follow, fixing it here would propagate the improvement automatically


{{APP_DESCRIPTION}}

![{{APP_TITLE}}]({{APP_IMAGE}})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

![{{APP_TITLE}}]({{APP_IMAGE}}) is a required-looking line with no guidance on what to do when no screenshot exists yet. a newly generated app won't have one. i suggest adding a comment like <!-- remove this line if no screenshot is available --> to prevent the agent from leaving a broken image reference in the final readme


**When to use:** User asks for OCR (PaddleOCR), or any PaddlePaddle model from HuggingFace.

**CRITICAL:** PaddlePaddle v3+ models use PIR format (`.json` + `.pdiparams`), **not** the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the note that paddleocr v3+ uses pir format (.json + .pdiparams) instead of .pdmodel is in the export template. could cause failures during model prep.

please move it to it to the surface explicitly in the paddleocr section of model-preparation.md so the agent encounters it during step 2 research, not only when copying the template.

Copy link
Copy Markdown
Contributor

@oonyshch oonyshch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added comments for potential improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants