How Close Are Open-Source LLMs to Closed Models? Findings from a Hands-On Test
Open-source large language models can handle more than many developers expect—but complex tasks still reveal gaps. This article walks through a real-world test where open-source models built an animated web page and rendered it into video, covering environment setup, structured prompting, frame-by-frame screenshots, and FFmpeg encoding. You'll learn where open-source models performed well, where they struggled, and how to decide between open-source and closed models for your own projects.
The Short Answer: Open-Source Models Cover More Ground Than Expected, But Complex Tasks Still Lag
In this test, open-source models independently handled web page generation, basic debugging, and dependency configuration. The gaps appeared mainly in three areas: code consistency across multiple rounds of revisions, instruction retention over long contexts, and stability in complex tool-calling chains. If your project is small to mid-sized, has clear requirements, and allows human review, open-source models are worth trying first. If your project demands high reliability and long, automated workflows, closed models remain the safer choice today.
Why Parameter Count Doesn’t Equal Capability
The open-source community has seen an intense parameter race recently. Some open-source model families have released models at the trillion-parameter scale, with exact sizes subject to the publisher’s documentation. Parameter count raises a model’s capacity ceiling, but real-world performance still depends on three things: training data quality, instruction tuning and alignment with human feedback, and engineering optimizations at inference time. A well-aligned mid-sized model can outperform a poorly tuned larger one on specific tasks. When choosing a model, test it against your own workloads rather than relying solely on leaderboards.
The Test Task: Generate a Web Page, Then Render It as Video
The task asked the model to build a vertical promotional animation page using HTML, CSS, and JavaScript. CSS and JavaScript drive the page animations, a headless browser captures screenshots frame by frame along a timeline, and FFmpeg encodes the result into an MP4. The task spans requirement understanding, UI design, code generation, debugging, and result verification—a long pipeline that’s well suited for observing a model’s overall performance.
I chose this task for three reasons. First, short videos and promo clips are a common, high-frequency need. Second, rendering video from a web page is an uncommon path, so the model must understand both front-end development and the rendering pipeline. Third, the task includes environment setup, coding, and runtime debugging, which exposes problems in long multi-step workflows.
Important caveat: this test ran a single task, with no standardized benchmark and no recorded model version numbers. The observations below apply only to this task and cannot be generalized to all scenarios.
Step 1: Check the Environment
You need three things: Node.js, npm, and a Chrome build that runs in headless mode. Check your versions:
node -vnpm -v
Use the Node.js LTS version. Create the project directory and initialize it:
mkdir video-render-democd video-render-demonpm init -ynpm install puppeteer
Puppeteer automatically downloads a matching Chrome version during installation. After installation, verify the browser launches:
node -e "require('puppeteer').launch({headless: true}).then(b => b.close()).then(() => console.log('ok'))"
If it prints ok, the browser works. Record the puppeteer version in package.json for future reproducibility.
You’ll also need FFmpeg to compose the screenshots into a video. On macOS, run brew install ffmpeg; on Debian or Ubuntu, run sudo apt install ffmpeg. Verify with ffmpeg -version.
If a tool prompts you to delete files in bulk during installation, review the deletion list first and confirm it only involves dependency directories like node_modules before approving.
Step 2: Turn Video Requirements into Structured Instructions
Break the requirements into fixed fields so they’re easy to modify repeatedly. Here’s the template:
Please generate a vertical promotional animation web page for the following product.
- Video duration: {duration} seconds
- Aspect ratio: {ratio, e.g., 9:16}
- Product name: {product name}
- Brand primary color: {color value}
- Number of scenes: {count}, with transition animations between scenes
- Copy: {text content for each scene}
- Ending: close-up of the brand logo, held for 2 seconds
- Technical requirement: all animations must be controlled by CSS or JavaScript, and provide the function window.seekToFrame(frame, fps) to jump to a specific frame
The last requirement is critical—the rendering script depends on this function. Without it, screenshots can’t be mapped precisely to individual frames.
Step 3: Preview and Iterate with Feedback
Open the generated HTML directly in a browser and check it scene by scene. Common issues fall into three categories: text overflowing its container, misplaced elements, and incorrect animation timing. When giving feedback, be specific about location and symptoms. For example: “The third heading wraps to two lines on the 1080×1920 canvas—reduce the font size or widen the container; the entrance animation in scene two is delayed by about 0.5 seconds—check animation-delay.”
In this test, open-source models could mostly locate problems when given specific descriptions. However, some models fell into a “fix one thing, break two” loop. Fix only one or two issues per round, then diff the new code against the previous version to confirm nothing new broke.
Step 4: Implement Frame-by-Frame Screenshots
Rendering requires the page to jump to any arbitrary frame. Add this function to video.html:
<script>window.seekToFrame = function (frame, fps) {const t = frame / fps;document.getAnimations().forEach((anim) => {anim.pause();anim.currentTime = t * 1000;});};</script>
This code pauses all CSS animations and Web Animations, then sets their time to the milliseconds corresponding to the target frame. If animations are driven by JavaScript logic using setTimeout or requestAnimationFrame, they need to read from the same time variable, otherwise screenshots won’t align with frame numbers.
Next, the rendering script—save it as render.js:
const fs = require('fs');const path = require('path');const { pathToFileURL } = require('url');const puppeteer = require('puppeteer');const FPS = 30;const DURATION_SEC = 20;const TOTAL_FRAMES = FPS * DURATION_SEC;const HTML_FILE = path.resolve(__dirname, 'video.html');const FRAME_DIR = path.resolve(__dirname, 'frames');async function main() {fs.mkdirSync(FRAME_DIR, { recursive: true });const browser = await puppeteer.launch({ headless: true });try {const page = await browser.newPage();await page.setViewport({ width: 1080, height: 1920 });await page.goto(pathToFileURL(HTML_FILE).href, { waitUntil: 'load' });await page.waitForFunction(() => typeof window.seekToFrame === 'function', { timeout: 10000 });for (let i = 0; i < TOTAL_FRAMES; i++) {await page.evaluate((frame, fps) => window.seekToFrame(frame, fps), i, FPS);const name = `frame_${String(i).padStart(4, '0')}.png`;await page.screenshot({ path: path.join(FRAME_DIR, name) });if (i % FPS === 0) console.log(`Rendered ${i}/${TOTAL_FRAMES} frames`);}} finally {await browser.close();}console.log('Screenshots complete. Next, compose the video with FFmpeg.');}main().catch((err) => {console.error(err);process.exit(1);});
Run node render.js. The script generates sequentially numbered PNG files in the frames directory.
Once screenshots are done, compose the video:
ffmpeg -y -framerate 30 -i frames/frame_%04d.png -c:v libx264 -pix_fmt yuv420p output.mp4
The -y flag overwrites an existing output.mp4 without prompting—only use it when you’re sure you want to replace the file. Screenshots with the same names will also be overwritten. If a previous render produced more frames, leftover old frames remain in the frames directory and may be mistakenly included during composition, so clear the directory before re-rendering. Before clearing, confirm the directory contains only screenshot files.
Also mind resource consumption before rendering. This example is 20 seconds at 30 fps—600 PNGs at 1080×1920, potentially consuming several hundred megabytes of disk. More frames means longer runtime and noticeably higher CPU usage. Consider setting DURATION_SEC to 5 first to validate the pipeline, then render the full version. If the script produces no output for a long time, images or fonts likely haven’t finished loading—check resource paths, or add waiting logic inside seekToFrame.
After composition, verify with spot checks. Export a random frame, such as frame 150, as an image with FFmpeg:
ffmpeg -i output.mp4 -vf "select=eq(n\,150)" -vframes 1 check.png
Compare it against the same frame’s screenshot in the browser to confirm there’s no element displacement, missing styling, or frame misalignment. You can compare visually or use ImageMagick’s compare command for pixel-level diffing.
Pitfalls to Avoid
Dependency installation failures. On Windows, some native modules require a specific Node.js version. If installation fails, upgrade to the LTS version or switch to a reliable npm mirror. Don’t manually replace the Chrome binary that puppeteer downloads automatically—version mismatches will cause problems.
Missing CJK fonts. Linux servers typically lack CJK fonts, causing garbled text or empty boxes in the video. On Debian or Ubuntu, install Noto Sans CJK with sudo apt install fonts-noto-cjk. Then run fc-list :lang=zh to confirm the font is available, and specify that font family in your CSS.
Animation jank and dropped frames. Prefer transform and opacity for animations—they’re generally cheaper than layout properties like left and top. Heavy blur filters significantly slow down screenshots; reduce their count or split them across separate layers.
Audio/video desync. The rendering pipeline above produces video only. Background music must be merged separately with FFmpeg and aligned to the video timeline. For example, to start the audio 0.5 seconds late:
ffmpeg -y -i output.mp4 -itsoffset 0.5 -i bgm.mp3 -map 0:v -map 1:a -c:v copy -shortest final.mp4
-itsoffset must be placed before its corresponding input file; it only affects the input that immediately follows it.
How to Choose: Open Source or Closed Model
For scenarios with clear requirements, short single-run tasks, and human-reviewable output, start with open-source models. They cost less and are easier to deploy privately.
For scenarios involving long contexts, multi-step automation, or long tool-calling chains, prefer testing closed models first—or add human checkpoints at critical nodes when using open-source models.
Once in production, regardless of which type you choose, build a regression test set. After any model or version change, regenerate outputs from the same set of requirements and compare the differences.
Don’t rely on parameter counts or leaderboards alone. Run the same requirements against each candidate model on your real tasks, at least three runs per requirement, and track the success rate and the number of manual fixes needed. The data you collect this way is far more relevant to your situation than any public benchmark.
Looking Ahead: Whether the Gap Narrows Depends on Three Conditions
Whether the gap between open-source and closed models continues to narrow depends on three factors: whether training data quality and scale keep improving, whether alignment and instruction tuning methods keep pace with task demands, and whether inference and deployment optimizations lower the barrier to use. Where all three advance together in a vertical domain, the gap will narrow there first. Otherwise, complex reasoning and long-context stability will still need further validation.
For the foreseeable future, both types of models will likely coexist. Open-source models fit controllable, privately deployable scenarios; closed models suit services with high stability requirements. Which one to choose ultimately comes down to validation results on your specific tasks.
