Agent skill

Klingai Performance Tuning

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Optimize Kling AI for speed, quality, and cost efficiency. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedMedia & Creative

Install Klingai Performance Tuning

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-performance-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace klingai-performance-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/klingai-performance-tuning .claude/skills/klingai-performance-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
klingai-performance-tuning
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
357 words
Files
6 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Optimize Kling AI for speed, quality, and cost efficiency. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 4 steps: Benchmark caching, model selection,… → Capture aggregate latency, error, task,… → Halt the canary on quality, policy,… → …
  • Improving generation times
  • SKILL.md covers Overview, Speed vs. Quality Matrix, Benchmarking Tool and Connection Pooling, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Klingai Performance Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Kling AI for speed, quality, and cost efficiency. Use when improving generation times or finding optimal settings. Trigger with phrases like 'klingai performance', 'kling ai optimize', 'faster klingai', 'klingai quality settings'.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/caching-layer.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code

It sits in Media & Creative, covering AI video generation. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Improving generation times
  • Finding optimal settings
  • With phrases like klingai performance
  • Kling ai optimize

Example prompts

  • “klingai performance”
  • “kling ai optimize”
  • “faster klingai”
  • “/klingai-performance-tuning”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Grep

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Benchmark caching, model selection, batching, and callback changes using bounded watermarked sandbox drafts only.
  2. Capture aggregate latency, error, task, and credit metrics; verify policy, rights, destination, retention, and removal controls before…
  3. Halt the canary on quality, policy, rights, budget, scope, or retention drift and restore the prior configuration.
  4. Promote tuning changes only after owner approval; retain a redacted benchmark receipt and remove temporary assets at the approved boundary.

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Klingai Performance Tuning loads about 1.8k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 357 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 357 words, ~1,821 tokens.

Download SKILL.mdSave it as .claude/skills/klingai-performance-tuning/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
klingai-performance-tuning
description
Optimize Kling AI for speed, quality, and cost efficiency. Use when improving generation times or finding optimal settings. Trigger with phrases like 'klingai performance', 'kling ai optimize', 'faster klingai', 'klingai quality settings'.
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
compatibility
Designed for Claude Code
version
1.18.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, kling-ai, performance, optimization

Kling AI Performance Tuning

Overview

Optimize video generation for your use case by choosing the right model, mode, and parameters. Covers benchmarking, speed vs. quality trade-offs, connection pooling, and caching strategies.

Speed vs. Quality Matrix

Config~Gen TimeQualityCredits (5s)Best For
v2.5-turbo + standard30-60sGood10Drafts, iteration
v2-master + standard60-90sHigh10Production previews
v2.6 + standard60-120sHighest10Quality-sensitive
v2.6 + professional120-300sHighest+35Final output
v2.6 + prof + audio180-400sHighest+200Full production

Benchmarking Tool

python
import time, requests, json

def benchmark_model(prompt: str, model: str, mode: str = "standard",
                    runs: int = 3) -> dict:
    """Benchmark generation time for a model/mode combination."""
    times = []

    for i in range(runs):
        start = time.monotonic()

        # Submit
        r = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={
            "model_name": model, "prompt": prompt, "duration": "5", "mode": mode,
        }).json()
        task_id = r["data"]["task_id"]

        # Poll
        while True:
            time.sleep(10)
            result = requests.get(
                f"{BASE}/videos/text2video/{task_id}", headers=get_headers()
            ).json()
            if result["data"]["task_status"] in ("succeed", "failed"):
                break

        elapsed = time.monotonic() - start
        times.append(elapsed)
        print(f"  Run {i+1}/{runs}: {elapsed:.1f}s ({result['data']['task_status']})")

    return {
        "model": model,
        "mode": mode,
        "avg_sec": round(sum(times) / len(times), 1),
        "min_sec": round(min(times), 1),
        "max_sec": round(max(times), 1),
        "runs": runs,
    }

# Compare models
prompt = "A waterfall in a tropical forest, cinematic"
for model in ["kling-v2-5-turbo", "kling-v2-master", "kling-v2-6"]:
    result = benchmark_model(prompt, model, runs=2)
    print(f"{model}: avg={result['avg_sec']}s, min={result['min_sec']}s")

Connection Pooling

python
import requests

# Without pooling: new TCP connection per request (slow)
# With pooling: reuse connections (fast)

session = requests.Session()
adapter = requests.adapters.HTTPAdapter(
    pool_connections=5,     # number of connection pools
    pool_maxsize=10,        # max connections per pool
    max_retries=3,          # auto-retry on connection errors
)
session.mount("https://", adapter)

# Use session instead of requests directly
response = session.post(f"{BASE}/videos/text2video", headers=get_headers(), json=body)

Prompt Optimization

Prompts that generate faster:

TechniqueWhy It Helps
Clear single subjectLess complexity to resolve
Specify camera angleReduces ambiguity
Avoid conflicting styles"realistic anime" confuses the model
Keep under 200 wordsShorter prompts process faster
Use negative promptsRemoves processing of unwanted elements
python
# Slow prompt (vague, conflicting)
slow = "A scene with many things happening, realistic but also artistic"

# Fast prompt (specific, clear)
fast = "A single red fox walking through snow, side view, natural lighting, 4K"

Caching Strategy

python
import hashlib

class PromptCache:
    """Cache results to avoid regenerating identical videos."""

    def __init__(self):
        self._cache = {}

    def _key(self, prompt: str, model: str, duration: int, mode: str) -> str:
        raw = f"{prompt}|{model}|{duration}|{mode}"
        return hashlib.sha256(raw.encode()).hexdigest()[:16]

    def get(self, prompt, model, duration, mode):
        key = self._key(prompt, model, duration, mode)
        return self._cache.get(key)

    def set(self, prompt, model, duration, mode, video_url):
        key = self._key(prompt, model, duration, mode)
        self._cache[key] = {
            "url": video_url,
            "cached_at": time.time(),
        }

cache = PromptCache()

def generate_with_cache(prompt, model="kling-v2-master", duration=5, mode="standard"):
    cached = cache.get(prompt, model, duration, mode)
    if cached:
        print(f"Cache hit: {cached['url']}")
        return cached["url"]

    # Generate
    result = client.text_to_video(prompt, model=model, duration=duration, mode=mode)
    url = result["videos"][0]["url"]
    cache.set(prompt, model, duration, mode, url)
    return url

Optimization Checklist

  • Use kling-v2-5-turbo for iteration, v2-6 for final
  • Use standard mode until final render
  • Connection pooling via requests.Session()
  • Cache identical prompt+param combinations
  • Prompt: specific, single subject, < 200 words
  • Batch submissions paced at 2-3s intervals
  • Use callback_url instead of polling
  • Download videos async (don't block on CDN download)

Prerequisites

  • An approved performance baseline, synthetic or rights-cleared test brief, sandbox workspace, content-policy review, credit cap, draft-only destination, and rollback/removal owner.
Show full SKILL.md (158 more words)Show less

Instructions

  1. Benchmark caching, model selection, batching, and callback changes using bounded watermarked sandbox drafts only.
  2. Capture aggregate latency, error, task, and credit metrics; verify policy, rights, destination, retention, and removal controls before comparison.
  3. Halt the canary on quality, policy, rights, budget, scope, or retention drift and restore the prior configuration.
  4. Promote tuning changes only after owner approval; retain a redacted benchmark receipt and remove temporary assets at the approved boundary.

Output

Produce a performance receipt with environment, baseline and aggregate measurements, model/configuration category, policy/rights/budget checks, draft-only assertion, owner approval, retention/removal proof, and rollback reference. Exclude prompts, assets, identities, and secrets.

Error Handling

ConditionResponse
Performance gain causes a policy, rights, or budget regressionStop the canary, restore the prior configuration, and remove the affected drafts.
Retention or destination control failsReject the run and correct the configuration before resuming.

Examples

env=staging; brief=synthetic; p95_delta=-18%; credits=within-cap; policy=pass; destination=draft-only; rollback=available supports approval.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/.curated/klingai-performance-tuning of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/caching-layer.md
  • references/errors.md
  • references/examples.md
  • references/optimization-strategies.md
  • references/performance-profiler.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Klingai Performance Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Klingai Performance Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Klingai Performance Tuning this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: PassMIT
Video Generationbytedance/deer-flow84k3 repos~1.4kAutomated safety check: PassMIT
Video Cover Imageitwanger/toBeBetterJavaer18k—~3.3kAutomated safety check: PassNone
Seedancesongguoxs/seedance-prompt-skill2.9k1 repos~2.5kAutomated safety check: PassNone
HyperFrames Video Entry Pointheygen-com/hyperframes60k3 repos~5.2kAutomated safety check: PassApache-2.0
Lanshu Create AI Presenter Videocclank/lanshu-create-ai-presenter-video2.6k—~3.6kAutomated safety check: PassMIT

Similar skills

  • Video Generation

    bytedance/deer-flow

    Generates short videos from a structured JSON prompt, optionally guided by a reference image used as the first or last frame.

    84k GitHub starsUsed in 3 repos~1.4k tokens
    Media & CreativeAuto-check passed
  • Video Cover Image

    itwanger/toBeBetterJavaer

    Generate matched 3:4, 16:9, and 4:3 short-video cover images from toBeBetterJavaer video scripts or AI/Java technical topics.

    18k GitHub stars~3.3k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • Seedance

    songguoxs/seedance-prompt-skill

    This skill should be used when the user asks to "generate video prompts", "create Seedance prompts", "write video descriptions", mentions "Seedance", "seedance", "即梦", "即梦平台", "视频提示词", "视频生成"…

    2.9k GitHub starsUsed in 1 repo~2.5k tokens
    Media & CreativeAuto-check passed
  • HyperFrames Video Entry Point

    heygen-com/hyperframes

    Entry point for making, editing and rendering videos from HTML compositions with HyperFrames, routing each request to the right workflow.

    60k GitHub starsUsed in 3 repos~5.2k tokens
    Media & CreativeAuto-check passed
  • Lanshu Create AI Presenter Video

    cclank/lanshu-create-ai-presenter-video

    Turn a topic or finished script into a complete, publish-ready explainer video — led by an AI presenter from an authorized adult presenter image, or performed in one of nine visual explainer styles…

    2.6k GitHub stars~3.6k tokensUpdated today
    Media & CreativeAuto-check passed
  • Video Shots

    eternityspring/reelbench-skills

    拉片:把一条成片拆成逐镜头的分析表——每个镜头的时长、景别、类别、运镜、画面. An agent skill from eternityspring/reelbench-skills.

    878 GitHub starsUsed in 1 repo~1.8k tokens
    Media & CreativeAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Klingai Performance Tuning

What does Klingai Performance Tuning do?

Optimize Kling AI for speed, quality, and cost efficiency. An agent skill from jeremylongshore/tons-of-skills-marketplace. Klingai Performance Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Kling AI for speed, quality, and cost efficiency.

When should I use Klingai Performance Tuning?

Klingai Performance Tuning fits situations like: improving generation times; finding optimal settings; with phrases like klingai performance; kling ai optimize.

How do I install Klingai Performance Tuning in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-performance-tuning -a claude-code`. Or copy the skill folder (skills/.curated/klingai-performance-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/klingai-performance-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Klingai Performance Tuning in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-performance-tuning -a codex`. Or copy the skill folder (skills/.curated/klingai-performance-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/klingai-performance-tuning in your project. Codex loads it when a task matches its description.

Can I use Klingai Performance Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-performance-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/klingai-performance-tuning, .gemini/skills/klingai-performance-tuning, .github/skills/klingai-performance-tuning and .opencode/skills/klingai-performance-tuning in your project.

What does Klingai Performance Tuning need to run?

SKILL.md names no scripts, command-line tools or credentials: Klingai Performance Tuning is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Klingai Performance Tuning access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Klingai Performance Tuning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Klingai Performance Tuning use?

Klingai Performance Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Klingai Performance Tuning use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Klingai Performance Tuning?

Skills that share tags, products or a category with Klingai Performance Tuning: Video Generation (bytedance/deer-flow, 84k stars), Video Cover Image (itwanger/toBeBetterJavaer, 18k stars), Seedance (songguoxs/seedance-prompt-skill, 2.9k stars) and HyperFrames Video Entry Point (heygen-com/hyperframes, 60k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Klingai Performance Tuning?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.