Open-Source LLM Coding Test: Building a Desktop Tool End to End
This article reports a hands-on test of using a current open-source large language model to build a deliverable desktop application: a batch audio/video extraction tool. It explains why benchmark coding scores do not guarantee production-ready software, how to write verifiable requirements instead of vague descriptions, what the model did well during code generation, and how a three-layer thread and queue design keeps the UI responsive. It also provides a robustness checklist, an iterative prompting approach, and a reusable prompt template that developers can apply to similar desktop tooling projects.
1. Test Background: Why “Can Generate Code” Is Not “Can Ship Software”
Open-source large models are iterating quickly, and public benchmark scores for coding keep being broken. One new open-source model release was described as improving by roughly fifty percent over the previous generation on code generation tasks, with overall performance compared against leading closed-source models. This kind of information has limited practical value for developers, for a simple reason: benchmark scores measure correctness at the function or problem level, while real delivery demands engineering-level usability — complete dependencies, handled exceptions, a responsive interface, and covered edge cases.
So this test deliberately avoided toy requests such as “write a quicksort” or “build a crawler.” Instead it picked a typical desktop utility: batch audio/video extraction. It is valuable because it covers filesystem traversal, format and parameter configuration, external dependency invocation, progress feedback, status reporting, and thread scheduling — nearly all the common hard parts of desktop tool development.
Note that this article does not evaluate any specific product. The subject is the general engineering question of how to use current mainstream AI coding tools to complete a deliverable desktop application.
2. Requirements Design: Replace Vague Descriptions With Verifiable Constraints
Prompt quality determines generation quality. Vague requirements such as “friendly interface, smooth performance” cannot be accepted or rejected, so the model can only produce boilerplate code that looks reasonable. This test wrote requirements as decidable items:
- Input side: support common video container formats; allow selecting a single file or an entire directory, with directories scanned recursively.
- Output side: support exporting to two mainstream audio formats, with encoding parameters (sample rate, bitrate, channel count) configurable.
- Interaction side: file list display, format and output directory settings, start/cancel/exit buttons, progress bar and status bar.
- Robustness side: a single file failure must not affect the whole task; existing output files with the same name must not be overwritten; missing dependencies must produce a clear message in advance.
- Non-functional: long-running tasks must not block the UI thread; the window must remain draggable and cancellable during conversion.
The last item is the dividing line of the whole requirement set. Putting a long-running loop on the main thread makes the interface unresponsive immediately. This is the most common defect in beginner-generated code, and the key difference between “it runs” and “it is usable.”
The reference prompt skeleton was:
Role: senior desktop application engineerTask: implement a batch audio/video extraction toolTech stack: Python + standard library GUI framework + external transcoding CLI toolHard constraints:1. All long-running operations must run in background threads; the main thread handles only UI and queue scheduling2. Provide cancellation; after cancellation, submit no new tasks3. Automatically append a sequence number when an output filename already exists4. On startup, detect whether the external transcoding tool is available; if missing, disable the start button and show a messageAcceptance criteria: recursive directory scan, progress updates, exception isolation, no UI freeze
3. Generation Observations: Key Steps From Requirements to Runnable Code
With deep reasoning / expert mode enabled, the model’s actual behavior followed a fairly clear engineering chain: parse the constraints and list an implementation plan, produce the code, run syntax and static checks, then add usage instructions. The whole process consumed very little quota, which suggests that cost is driven mainly not by code length but by whether multiple rounds of rework are needed.
Several instances of proactive completion in the generated result deserve credit:
- Recursive directory traversal with filtering by an extension whitelist, rather than simply reading one level of files.
- Automatic completion of common audio/video extensions, reducing user configuration effort.
- Automatic numbering of duplicate output names, avoiding silent overwrites and data loss.
- External transcoding dependency detection at startup, moving runtime errors forward to launch time.
None of these were explicitly stated in the requirements. They are transfers of domain common sense, and an important sign of the current model’s improved capability.
4. Architecture Breakdown: Responsiveness Comes From Separating Threads and Queues
The root cause of a desktop tool “freezing” is almost always the same: the main thread is doing blocking work. The correct split is a three-layer structure.
- UI thread: handles only event rendering and widget state, performs no I/O.
- Scheduling layer: maintains the task queue, takes tasks, submits tasks, and keeps counts.
- Worker thread: executes the transcoding subprocess call and returns progress and results through a thread-safe queue.
A sketch implementation:
import queueimport threadingimport tkinter as tkmsg_q = queue.Queue()def worker(task_q, msg_q):while True:item = task_q.get()if item is None:task_q.task_done()breaksrc, dst, args = itemtry:# Call the external transcoding tool and parse its stdout to get progressprogress = run_transcode(src, dst, args)msg_q.put(("ok", src, progress))except Exception as exc:msg_q.put(("err", src, str(exc)))finally:task_q.task_done()def poll_messages(root, bar, status):try:while True:kind, name, payload = msg_q.get_nowait()if kind == "ok":bar["value"] = payloadstatus.set(f"Done: {name}")else:status.set(f"Failed: {name} -> {payload}")except queue.Empty:passroot.after(100, poll_messages, root, bar, status)
The key point is the root.after polling: worker threads never touch widgets directly, they only post messages, and the UI thread consumes them at a fixed interval. This fundamentally avoids the random crashes caused by cross-thread UI operations.
5. Robustness Checklist: “Demo-Ready” Versus “Production-Ready”
Generated code usually covers the main flow; the gaps concentrate in exceptions and edge cases. Accept the result item by item against this checklist:
- Missing dependency: when the external transcoding tool is unavailable, show a message at startup and disable the entry point.
- Path issues: create the output directory if it does not exist; paths containing spaces and Chinese characters must be escaped correctly.
- Naming conflicts: append a sequence number to duplicates, or generate names by the “sourcefilename_number” rule.
- Task isolation: a single file failure is only logged and does not interrupt the queue.
- Cancellation semantics: after cancellation, stop submitting new tasks; already-started subprocesses must be terminated and reaped.
- Encoding parameter validation: intercept illegal bitrates and sample rates before they enter the queue.
- Resource release: clean up temporary files and subprocess handles when finished.
- Observability: the status bar shows the current item and the total, and logs are written to a local file for troubleshooting.
6. Iterative Follow-Up: Turning One-Shot Generation Into Controlled Convergence
One valuable action during the test was to keep asking about default behavior, for example the default value of the output directory. Such follow-ups matter because they expose implicit assumptions: defaulting to the program’s own directory fails outright in read-only installation paths or permission-restricted environments. A reasonable default strategy is to prefer the user-selected directory, then fall back to an application data location under the system user directory, and display the final path explicitly in the UI.
The recommended iteration style is “small-step convergence”: add only one or two constraints per round and ask the model to explain what changed and what it affects, avoiding a single large pile of requirements that causes regressions.
7. Reusable Prompt Template and Practical Advice
- Define acceptance criteria first, then write implementation requirements.
- State the thread model and cancellation semantics explicitly.
- Ask for a dependency list and first-run prerequisites.
- Require a user-visible message for every exception branch.
- After generation, run three cases locally: normal conversion, a failing file, and a missing dependency.
To productize this kind of tool, you can further introduce object storage as an input/output relay, a message queue to decouple long tasks, and a container platform to isolate the transcoding environment, together with log services and monitoring alerts to locate production issues. These are general cloud engineering practices, independent of any specific vendor.
8. Conclusion
Progress in open-source models on coding tasks is now enough to compress “writing a well-structured, thread-safe, exception-complete desktop utility” from hours to minutes — but the prerequisite is still that the developer supplies verifiable constraints and can review code. The model provides breadth and first-draft speed; engineering judgment and edge-case backstops remain human responsibilities. Writing requirements as a checklist, writing acceptance as test cases, and breaking iteration into small steps is the reliable path to consistently high-quality code.
