{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-01-28-we-got-claude-to-build-cuda-kernels-and-teach-open-models/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "The best thing about agent skills is *upskilling* your agents on hard problems. There are two ways to look at that:\n\n1. You can take Opus 4.5 or other SOTA models and tackle the hardest problems out there.\n2. You can take models that run on your laptop and upskill them to harder problems. In this blog post, we’ll show you how to take on the latter.\n\nThis blog post walks through the process of using a new tool, `upskill`, to generate and evaluate agent skills with large models and use them with smaller models. We will benchmark `upskill` on the task of writing CUDA kernels for [`diffusers`](https://huggingface.co/docs/diffusers/en/index) models, but the process is generally useful for cutting costs, or using smaller models on hard and domain-specific problems.\n\n## What are agent skills?\n\nIn case you missed it, agent skills are taking the coding agent game by storm. In fact, they’re a straightforward concept to define model context as files, like instructions as markdown and code as scripts. The file format makes them easy to generate, share, and review. In short, they’re a practical medium to share capabilities across models and tools, and they're most useful in specific domains or hard problems. Not stuff the model can do well anyway.\n\nThis post showcases this process by using Claude to generate a Skill file that can be used by open source models for a complex and specialized task: write CUDA kernels. We first tried a simple skill based on existing documentation, and we found that it improved performance for some others, but not all. In fact, it could even degrade performance or increase token usage for some models. Check out the plot below to see the performance of the model with and without the basic skill.\n\n[![plot of model performance](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/plot.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/plot.png)\n\nNow, let's walk through how you can use `upskill` to upskill your agents on hard problems, and measure performance.\n\n## 1. Get the teacher (Claude Opus 4.5) to build a kernel\n\nFirst, we use Claude Code to build a kernel interactively and export the trace. We worked through the process by instructing, validating, and adding documentation links. This somewhat naive process is important to reveal the models' initial challenges. In fact, you can iterate on this multiple times, by trying to solve the task with draft versions of the skill, and experimenting with smaller models. Each time, you can instruct the agent to improve the skill and test it on the smaller model.\n\nHere's an [example of the skill](https://huggingface.co/hf-skills/h100-diffusers-kernel-builder) that we created and have been using to build kernels. We started from this [agent trace](https://huggingface.co/hf-skills/h100-diffusers-kernel-builder/blob/main/agent-trace.txt) where the agent was able to build a kernel, but not without some help.\n\n## 2. Make an agent skill from the trace\n\nOnce the teacher model has performed the task, we need them to make a skill. There are a number of effective ways to do this.\n\n- Within the same session, instruct the agent to create a skill file for the task it just completed.\n- Use [Anthropic ‘skill creator’ skill](https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md) either within the agent session or with an exported trace and a new agent session.\n- Use the `upskill` tool to create a skill based on the trace.\n\nIn most cases, the first 2 options result in functional skills. However, the performance of an agent with the skill is unknown. That’s where `upskill` is useful, because it will also generate test cases for your skill based on the trace. It then compares the results under both scenarios: using the trace, or applying the skill. We see below that the original model (Claude Opus) met the same performance with and without the skill. This means the skill captured the task *for this model*. Great!\n\n[![terminal evaluation](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/terminal.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/terminal.png)\n\n## 3. Take your skill to an open source, smaller, or cheaper model\n\nFinally, we need to transfer our newly created skill to the tool or model we intend to use. Most tools like `codex`, `cursor`, and `opencode` have settled on a consistent format for skills, which is a directory at `{agent}/skills/{skill_name}/SKILL.md` , so we just need to copy the skill directory to this location.\n\nWith `upskill` we can pass a skill and a set of models to the `eval` command and `upskill` will run the test cases on those models with and without the skill to compare performance. We can see here that the skill increases accuracy on some open models, but not on all.\n\n[![performance evaluation](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/accuracy.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/accuracy.png)\n\nIn this case, we might want to iterate further on the `gpt-oss` skills by regenerating the skill. We can do `upskill generate --from {skill}`.\n\nThere is more to agent skills than model performance. Often agents can reach a given accuracy with or without a skill, they just need to consume more tokens to get there. For recurring tasks, we want to optimize agents to use less tokens to achieve the same accuracy. The results below reveal another dimension to the skill. Some models are significantly reducing their performance token usage, whilst others are using more tokens **with** the skill. For example, with [`moonshotai/Kimi-K2-Thinking`](https://huggingface.co/moonshotai/Kimi-K2-Thinking) the skill is clearly effective in terms of accuracy and token usage. However, for Claude Opus 4.5 there is no clear performance increase and an increase in token usage, so you would not want to use this skill with Claude Opus 4.5.\n\n[![token usage](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/tokens.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/tokens.png)\n\n**tldr;** try out and evaluate models with the skills you create. Use `upskill eval` or a similar tool to evaluate the models performance with and without skills.\n\nThat’s the high level end to end of upskilling your coding agents on hard problems. Try out upskill now like this:\n\n```shell\n# install upskill\npip install upskill\n\n# or use uvx \nuvx upskill --help\n\n# generate a skill based on an agent trace\nupskill generate \"write nvidia kernels\" --from ./trace.md\n\u000b# evaluate models on a skill\nupskill eval ./skills/my-skill/ --model haiku --model sonnet\n\n# generate skills for local models\nupskill generate \"parse YAML\" \n    --model opus \n    --eval-model \"unsloth/GLM-4.7-Flash-GGUF:Q4_0\" \n    --eval-base-url http://localhost:8080/v1\n```\n\n## Deep dive tutorial into building kernels with agent skills\n\nWe have a high level understanding of how we can upskill an agent. Let’s now look at the use case we solved for writing CUDA kernels.\n\nWe didn’t just want to write kernel code, but understand the full kernel-builder workflow: project structure, `build.toml` configuration, architecture-specific optimizations, and PyTorch bindings. This tutorial shows how upskill creates validated skills that actually work.\n\nThe [`kernel-builder-cuda-kernels`](https://github.com/burtenshaw/kernel-skill) skill teaches Claude everything it needs to know about CUDA development: which GPU architecture to target, how to structure a kernel-builder project, when to use shared memory versus registers, and how to write PyTorch bindings.\n\nWith this skill, you can tell Claude things like:\n\n```\nBuild a fused LayerNorm + GELU kernel optimized for H100.\n```\n\nAnd Claude will create the complete project structure, CUDA implementation, and build configuration—following the exact conventions that kernel-builder expects.\n\nThis isn't about generating boilerplate. The skill encodes domain expertise: H100 uses compute capability 9.0, shared memory should be aligned to 128 bytes, async memory copies require `__CUDA_ARCH__ >= 900`. Knowledge that would take hours to gather from documentation gets packaged into ~500 tokens that load on demand.\n\n## Setup and Install\n\nInstall upskill:\n\n```shell\npip install upskill\n# or use uvx for one-off runs\nuvx upskill --help\n```\n\nSet your API key:\n\n```shell\nexport ANTHROPIC_API_KEY=sk-ant-...\nexport HF_TOKEN=hf_...\n```\n\nThat's it. Upskill uses Anthropic Claude Opus-4.5 model by default but also supports OpenAI and local models via OpenAI-compatible endpoints as generators. We want to use the more expensive and higher quality models to generate skills, and the smaller ones to use them. Think robin hood.\n\n## Skill Generation\n\nLet's walk through generating a skill that teaches agents how to build CUDA kernels with HuggingFace's [`kernels`](https://github.com/huggingface/kernels) library.\n\n### Generate the Skill\n\nStart with a clear task description:\n\n```shell\nupskill generate \"build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder\"\n```\n\nAbove we used upskill, but it could in fact be any agent or chat tool and an exported trace.\n\n```shell\nupskill generate \"write kernels\" --from <agent-trace>.md\n```\n\nAlso, we could start from an existing skill and add to it:\n\n```shell\nupskill generate \"add more error handling and edge cases\" \n    --from ./skills/kernel-builder-cuda-kernels/\n```\n\nupskill loads the existing skill, applies your improvements, and re-evaluates to ensure the changes help.\n\nupskill creates a skill, generates test cases, evaluates performance, and refines based on failures:\n\n```\nGenerating skill with sonnet...\nGenerating test cases...\nEvaluating on sonnet... (attempt 1)\n  60% -> 95% (+35%) OK\n\n  kernel-builder-cuda-kernels\n  Build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder.\n\n  SKILL.md              ~520 tokens\n\n  baseline   ████████████                60%\n  with skill ███████████████████    95%  (+35%)\n\nSaved to ./skills/kernel-builder-cuda-kernels\n```\n\nThe baseline shows how the model performs without any skill. The \"with skill\" result shows performance after the skill is injected into context. A 35% improvement means the skill is working.\n\nThe skill is saved as a directory following the [Agent Skills specification](https://agentskills.io):\n\n```\n./skills/kernel-builder-cuda-kernels/\n├── SKILL.md           # Main instructions (~520 tokens)\n└── skill_meta.json    # Metadata and test cases\n```\n\nOpen \\`SKILL.md\\` to see what upskill generated:\n\n```\n---\nname: kernel-builder-cuda-kernels\ndescription: Build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder.\n---\n\n# Building CUDA Kernels with kernel-builder\n\n## Overview\n\nThis guide explains how to create optimized CUDA kernels for PyTorch models \nusing HuggingFace's kernel-builder. It covers project setup, kernel implementation, \nand building for specific GPU architectures like NVIDIA H100.\n\n## Project Structure\n\nproject/\n├── build.toml              # Build configuration\n├── kernel_src/             # CUDA kernel implementations\n│   ├── attention.cu\n│   ├── layernorm.cu\n│   └── geglu.cu\n└── torch-ext/              # PyTorch C++ bindings\n    └── torch_binding.cpp\n\n## Build Configuration\n\nCreate `build.toml` to define your kernel package:\n\n[general]\nname = \"diffuser_kernels\"\nbackends = [\"cuda\"]\n\n[general.cuda]\n# H100 is compute capability 9.0\ncapabilities = [\"9.0\"]\n\n...\n```\n\n### Evaluate on a Different Model\n\nThe important test is: does this skill help local or cheaper models to build kernels?\n\n```shell\n# Start a local OpenAI-compatible server with a web UI:\nllama-server -hf unsloth/GLM-4.7-Flash-GGUF:Q4_K_M\n\n# Evaluate on local model (llama.cpp server)\nupskill eval ./skills/my-skill/ \n    --model \"unsloth/GLM-4.7-Flash-GGUF:Q4_0\" \n    --base-url http://localhost:8080/v1\n```\n\n```\nGenerating skill with sonnet...\nGenerating test cases...\nEvaluating on \"unsloth/GLM-4.7-Flash-GGUF:Q4_0\"... (attempt 1)\n  40% -> 85% (+45%) OK\n\n  baseline   ████████░░░░░░░░░░░░   40%\n  with skill █████████████████░░░   85%  (+45%)\n\nSaved to ./skills/kernel-builder-cuda-kernels\n```\n\nA 45% improvement on `\"unsloth/GLM-4.7-Flash-GGUF:Q4_0\"` means the skill successfully transfers domain knowledge from a capable model to a faster, cheaper one. Skills that work on weaker models will definitely work on stronger ones.\n\nThis is the core value proposition: use expensive models to create skills, then deploy those skills with cheap or local models.\n\n## How the evaluation in upskill works\n\nupskill uses a teacher-student approach to evaluate models where the teacher model generates test cases for the student model to be evaluated on.\n\n1. **Teacher model** (Opus) generates the skill\n2. **Test cases** (Opus) are generated automatically from the task description\n3. **Student model** (local) is evaluated with and without the skill\n4. **Skill lift** measures the improvement\n\nIf you pass an existing skill to `upskill eval`, it will generate test cases for the skill and evaluate the model on them. Test cases are simple input/output pairs that verify the agent understands the task:\n\n```json\n{\n  \"cases\": [\n    {\n      \"input\": \"Create a build.toml for a CUDA kernel targeting H100\",\n      \"expected\": {\"contains\": \"9.0\"}\n    },\n    {\n      \"input\": \"Write a basic CUDA kernel template with proper includes\",\n      \"expected\": {\"contains\": \"cuda_runtime.h\"}\n    }\n  ]\n}\n```\n\nWe can also test how a skill performs across different models:\n\n```shell\nupskill eval ./skills/kernel-builder-cuda-kernels/ \n    --model haiku --m kimi --runs 5\n```\n\n```\nEvaluating kernel-builder-cuda-kernels across 2 model(s)\n  3 test case(s), 5 run(s) per model\n\nhaiku\n  Pass rate: 4/5 (80%)  Avg assertions: 2.8/3\n\nsonnet  \n  Pass rate: 5/5 (100%)  Avg assertions: 3.0/3\n\n┏━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓\n┃ Model  ┃ Pass Rate ┃ Avg Assertions ┃ Avg Tokens ┃\n┡━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩\n│ haiku  │ 4/5       │ 2.8/3          │ 1250       │\n│ kimi   │ 5/5       │ 3.0/3          │ 1890       │\n└────────┴───────────┴────────────────┴────────────┘\n```\n\nThis helps you find the cost-performance sweet spot: maybe Haiku with the skill is good enough for your use case, saving significant API costs.\n\n## What's Next\n\nWe've shown that upskill can create validated skills that transfer domain expertise from powerful models to cheaper ones. The kernel-builder skill is just one example of what's possible.\n\nSome things to try:\n\n- **Generate skills for your internal tools**\n- **Build a skill library for your codebase**\n- **Capture tribal knowledge**\n- **Benchmark across models**\n\nThe approach works for any specialized task where you'd otherwise write detailed prompts repeatedly. Skills are portable across [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Codex](https://github.com/openai/codex), [Cursor](https://cursor.com/docs/context/skills), and other tools that support the [Agent Skills specification](https://agentskills.io).\n\n## Resources\n\n- [Upskill repo](https://github.com/huggingface/upskill)\n- [Agent Skills Specification](https://agentskills.io)\n- [HuggingFace kernel-builder](https://github.com/huggingface/kernels/tree/main/kernel-builder)\n",
  "authors": [],
  "captured_at": "2026-10-04T12:50:30.804479567+00:00",
  "category": "ai",
  "content_html": "<p>The best thing about agent skills is <em>upskilling</em> your agents on hard problems. There are two ways to look at that:</p>\n<ol>\n<li>You can take Opus 4.5 or other SOTA models and tackle the hardest problems out there.</li>\n<li>You can take models that run on your laptop and upskill them to harder problems. In this blog post, we’ll show you how to take on the latter.</li>\n</ol>\n<p>This blog post walks through the process of using a new tool, <code>upskill</code>, to generate and evaluate agent skills with large models and use them with smaller models. We will benchmark <code>upskill</code> on the task of writing CUDA kernels for <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/diffusers/en/index\"><code>diffusers</code></a> models, but the process is generally useful for cutting costs, or using smaller models on hard and domain-specific problems.</p>\n<h2>What are agent skills?</h2>\n<p>In case you missed it, agent skills are taking the coding agent game by storm. In fact, they’re a straightforward concept to define model context as files, like instructions as markdown and code as scripts. The file format makes them easy to generate, share, and review. In short, they’re a practical medium to share capabilities across models and tools, and they're most useful in specific domains or hard problems. Not stuff the model can do well anyway.</p>\n<p>This post showcases this process by using Claude to generate a Skill file that can be used by open source models for a complex and specialized task: write CUDA kernels. We first tried a simple skill based on existing documentation, and we found that it improved performance for some others, but not all. In fact, it could even degrade performance or increase token usage for some models. Check out the plot below to see the performance of the model with and without the basic skill.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/plot.png\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/plot.png\" alt=\"plot of model performance\" loading=\"eager\" decoding=\"async\" fetchpriority=\"high\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<p>Now, let's walk through how you can use <code>upskill</code> to upskill your agents on hard problems, and measure performance.</p>\n<h2>1. Get the teacher (Claude Opus 4.5) to build a kernel</h2>\n<p>First, we use Claude Code to build a kernel interactively and export the trace. We worked through the process by instructing, validating, and adding documentation links. This somewhat naive process is important to reveal the models' initial challenges. In fact, you can iterate on this multiple times, by trying to solve the task with draft versions of the skill, and experimenting with smaller models. Each time, you can instruct the agent to improve the skill and test it on the smaller model.</p>\n<p>Here's an <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/hf-skills/h100-diffusers-kernel-builder\">example of the skill</a> that we created and have been using to build kernels. We started from this <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/hf-skills/h100-diffusers-kernel-builder/blob/main/agent-trace.txt\">agent trace</a> where the agent was able to build a kernel, but not without some help.</p>\n<h2>2. Make an agent skill from the trace</h2>\n<p>Once the teacher model has performed the task, we need them to make a skill. There are a number of effective ways to do this.</p>\n<ul>\n<li>Within the same session, instruct the agent to create a skill file for the task it just completed.</li>\n<li>Use <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md\">Anthropic ‘skill creator’ skill</a> either within the agent session or with an exported trace and a new agent session.</li>\n<li>Use the <code>upskill</code> tool to create a skill based on the trace.</li>\n</ul>\n<p>In most cases, the first 2 options result in functional skills. However, the performance of an agent with the skill is unknown. That’s where <code>upskill</code> is useful, because it will also generate test cases for your skill based on the trace. It then compares the results under both scenarios: using the trace, or applying the skill. We see below that the original model (Claude Opus) met the same performance with and without the skill. This means the skill captured the task <em>for this model</em>. Great!</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/terminal.png\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/terminal.png\" alt=\"terminal evaluation\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<h2>3. Take your skill to an open source, smaller, or cheaper model</h2>\n<p>Finally, we need to transfer our newly created skill to the tool or model we intend to use. Most tools like <code>codex</code>, <code>cursor</code>, and <code>opencode</code> have settled on a consistent format for skills, which is a directory at <code>{agent}/skills/{skill_name}/SKILL.md</code> , so we just need to copy the skill directory to this location.</p>\n<p>With <code>upskill</code> we can pass a skill and a set of models to the <code>eval</code> command and <code>upskill</code> will run the test cases on those models with and without the skill to compare performance. We can see here that the skill increases accuracy on some open models, but not on all.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/accuracy.png\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/accuracy.png\" alt=\"performance evaluation\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<p>In this case, we might want to iterate further on the <code>gpt-oss</code> skills by regenerating the skill. We can do <code>upskill generate --from {skill}</code>.</p>\n<p>There is more to agent skills than model performance. Often agents can reach a given accuracy with or without a skill, they just need to consume more tokens to get there. For recurring tasks, we want to optimize agents to use less tokens to achieve the same accuracy. The results below reveal another dimension to the skill. Some models are significantly reducing their performance token usage, whilst others are using more tokens <strong>with</strong> the skill. For example, with <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/moonshotai/Kimi-K2-Thinking\"><code>moonshotai/Kimi-K2-Thinking</code></a> the skill is clearly effective in terms of accuracy and token usage. However, for Claude Opus 4.5 there is no clear performance increase and an increase in token usage, so you would not want to use this skill with Claude Opus 4.5.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/tokens.png\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/tokens.png\" alt=\"token usage\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<p><strong>tldr;</strong> try out and evaluate models with the skills you create. Use <code>upskill eval</code> or a similar tool to evaluate the models performance with and without skills.</p>\n<p>That’s the high level end to end of upskilling your coding agents on hard problems. Try out upskill now like this:</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> install upskill</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">pip</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> install upskill</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> or use uvx </span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">uvx</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> upskill<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>help</span></span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> generate a skill based on an agent trace</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> generate <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>write nvidia kernels<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>from</span> ./trace.md</span>\n\u000b<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> evaluate models on a skill</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> eval ./skills/my-skill/<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>model</span> haiku<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>model</span> sonnet</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> generate skills for local models</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> generate <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>parse YAML<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span> </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--model</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> opus </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--eval-model</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>unsloth/GLM-4.7-Flash-GGUF:Q4_0<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span> </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--eval-base-url</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> http://localhost:8080/v1</span>\n</span></span></code></pre>\n<h2>Deep dive tutorial into building kernels with agent skills</h2>\n<p>We have a high level understanding of how we can upskill an agent. Let’s now look at the use case we solved for writing CUDA kernels.</p>\n<p>We didn’t just want to write kernel code, but understand the full kernel-builder workflow: project structure, <code>build.toml</code> configuration, architecture-specific optimizations, and PyTorch bindings. This tutorial shows how upskill creates validated skills that actually work.</p>\n<p>The <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/burtenshaw/kernel-skill\"><code>kernel-builder-cuda-kernels</code></a> skill teaches Claude everything it needs to know about CUDA development: which GPU architecture to target, how to structure a kernel-builder project, when to use shared memory versus registers, and how to write PyTorch bindings.</p>\n<p>With this skill, you can tell Claude things like:</p>\n<pre><code><span class=\"code-snippet\">Build a fused LayerNorm + GELU kernel optimized for H100.\n</span></code></pre>\n<p>And Claude will create the complete project structure, CUDA implementation, and build configuration—following the exact conventions that kernel-builder expects.</p>\n<p>This isn't about generating boilerplate. The skill encodes domain expertise: H100 uses compute capability 9.0, shared memory should be aligned to 128 bytes, async memory copies require <code>__CUDA_ARCH__ &gt;= 900</code>. Knowledge that would take hours to gather from documentation gets packaged into ~500 tokens that load on demand.</p>\n<h2>Setup and Install</h2>\n<p>Install upskill:</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">pip</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> install upskill</span>\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> or use uvx for one-off runs</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">uvx</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> upskill<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>help</span></span>\n</span></span></code></pre>\n<p>Set your API key:</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-storage syntax-modifier syntax-shell\">export</span> <span class=\"syntax-variable syntax-other syntax-readwrite syntax-assignment syntax-shell\">ANTHROPIC_API_KEY</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-shell\">=</span><span class=\"syntax-string syntax-unquoted syntax-shell\">sk-ant-...</span></span>\n<span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-storage syntax-modifier syntax-shell\">export</span> <span class=\"syntax-variable syntax-other syntax-readwrite syntax-assignment syntax-shell\">HF_TOKEN</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-shell\">=</span><span class=\"syntax-string syntax-unquoted syntax-shell\">hf_...</span></span>\n</span></span></code></pre>\n<p>That's it. Upskill uses Anthropic Claude Opus-4.5 model by default but also supports OpenAI and local models via OpenAI-compatible endpoints as generators. We want to use the more expensive and higher quality models to generate skills, and the smaller ones to use them. Think robin hood.</p>\n<h2>Skill Generation</h2>\n<p>Let's walk through generating a skill that teaches agents how to build CUDA kernels with HuggingFace's <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/kernels\"><code>kernels</code></a> library.</p>\n<h3>Generate the Skill</h3>\n<p>Start with a clear task description:</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> generate <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span></span>\n</span></span></code></pre>\n<p>Above we used upskill, but it could in fact be any agent or chat tool and an exported trace.</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> generate <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>write kernels<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>from</span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-redirection syntax-shell\">&lt;</span>agent-trace<span class=\"syntax-keyword syntax-operator syntax-assignment syntax-redirection syntax-shell\">&gt;</span>.md</span>\n</span></span></code></pre>\n<p>Also, we could start from an existing skill and add to it:</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> generate <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>add more error handling and edge cases<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span> </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--from</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> ./skills/kernel-builder-cuda-kernels/</span>\n</span></span></code></pre>\n<p>upskill loads the existing skill, applies your improvements, and re-evaluates to ensure the changes help.</p>\n<p>upskill creates a skill, generates test cases, evaluates performance, and refines based on failures:</p>\n<pre><code><span class=\"code-snippet\">Generating skill with sonnet...\nGenerating test cases...\nEvaluating on sonnet... (attempt 1)\n  60% -&gt; 95% (+35%) OK\n\n  kernel-builder-cuda-kernels\n  Build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder.\n\n  SKILL.md              ~520 tokens\n\n  baseline   ████████████                60%\n  with skill ███████████████████    95%  (+35%)\n\nSaved to ./skills/kernel-builder-cuda-kernels\n</span></code></pre>\n<p>The baseline shows how the model performs without any skill. The &quot;with skill&quot; result shows performance after the skill is injected into context. A 35% improvement means the skill is working.</p>\n<p>The skill is saved as a directory following the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://agentskills.io\">Agent Skills specification</a>:</p>\n<pre><code><span class=\"code-snippet\">./skills/kernel-builder-cuda-kernels/\n├── SKILL.md           # Main instructions (~520 tokens)\n└── skill_meta.json    # Metadata and test cases\n</span></code></pre>\n<p>Open `SKILL.md` to see what upskill generated:</p>\n<pre><code><span class=\"code-snippet\" data-language=\"YAML\"><span class=\"syntax-source syntax-yaml\"><span class=\"syntax-entity syntax-other syntax-document syntax-begin syntax-yaml\">---</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\"><span class=\"syntax-entity syntax-name syntax-tag syntax-yaml\">name</span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-mapping syntax-yaml\">:</span> <span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">kernel-builder-cuda-kernels</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\"><span class=\"syntax-entity syntax-name syntax-tag syntax-yaml\">description</span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-mapping syntax-yaml\">:</span> <span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">Build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder.</span>\n<span class=\"syntax-entity syntax-other syntax-document syntax-begin syntax-yaml\">---</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span> Building CUDA Kernels with kernel-builder\n</span>\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span># Overview\n</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">This guide explains how to create optimized CUDA kernels for PyTorch models</span> \n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">using HuggingFace&#39;s kernel-builder. It covers project setup, kernel implementation,</span> \n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">and building for specific GPU architectures like NVIDIA H100.</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span># Project Structure\n</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">project/</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">├── build.toml</span>              <span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span> Build configuration\n</span><span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">├── kernel_src/</span>             <span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span> CUDA kernel implementations\n</span><span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">│   ├── attention.cu</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">│   ├── layernorm.cu</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">│   └── geglu.cu</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">└── torch-ext/</span>              <span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span> PyTorch C++ bindings\n</span>    <span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">└── torch_binding.cpp</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span># Build Configuration\n</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\"><span class=\"syntax-entity syntax-name syntax-tag syntax-yaml\">Create `build.toml` to define your kernel package</span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-mapping syntax-yaml\">:</span>\n\n<span class=\"syntax-meta syntax-flow-sequence syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-sequence syntax-begin syntax-yaml\">[</span><span class=\"syntax-string syntax-unquoted syntax-plain syntax-in syntax-yaml\">general</span><span class=\"syntax-punctuation syntax-definition syntax-sequence syntax-end syntax-yaml\">]</span></span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">name = &quot;diffuser_kernels&quot;</span>\n<span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">backends = [&quot;cuda&quot;]</span>\n\n<span class=\"syntax-meta syntax-flow-sequence syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-sequence syntax-begin syntax-yaml\">[</span><span class=\"syntax-string syntax-unquoted syntax-plain syntax-in syntax-yaml\">general.cuda</span><span class=\"syntax-punctuation syntax-definition syntax-sequence syntax-end syntax-yaml\">]</span></span>\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-yaml\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-line syntax-number-sign syntax-yaml\">#</span> H100 is compute capability 9.0\n</span><span class=\"syntax-string syntax-unquoted syntax-plain syntax-out syntax-yaml\">capabilities = [&quot;9.0&quot;]</span>\n\n<span class=\"syntax-entity syntax-other syntax-document syntax-end syntax-yaml\">...</span>\n</span></span></code></pre>\n<h3>Evaluate on a Different Model</h3>\n<p>The important test is: does this skill help local or cheaper models to build kernels?</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> Start a local OpenAI-compatible server with a web UI:</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">llama-server</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> -</span>hf</span> unsloth/GLM-4.7-Flash-GGUF:Q4_K_M</span>\n\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-begin syntax-shell\">#</span></span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\"> Evaluate on local model (llama.cpp server)</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-shell\">\n</span><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> eval ./skills/my-skill/ </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--model</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> <span class=\"syntax-string syntax-quoted syntax-double syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-shell\">&quot;</span>unsloth/GLM-4.7-Flash-GGUF:Q4_0<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-shell\">&quot;</span></span> </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--base-url</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> http://localhost:8080/v1</span>\n</span></span></code></pre>\n<pre><code><span class=\"code-snippet\">Generating skill with sonnet...\nGenerating test cases...\nEvaluating on &quot;unsloth/GLM-4.7-Flash-GGUF:Q4_0&quot;... (attempt 1)\n  40% -&gt; 85% (+45%) OK\n\n  baseline   ████████░░░░░░░░░░░░   40%\n  with skill █████████████████░░░   85%  (+45%)\n\nSaved to ./skills/kernel-builder-cuda-kernels\n</span></code></pre>\n<p>A 45% improvement on <code>&quot;unsloth/GLM-4.7-Flash-GGUF:Q4_0&quot;</code> means the skill successfully transfers domain knowledge from a capable model to a faster, cheaper one. Skills that work on weaker models will definitely work on stronger ones.</p>\n<p>This is the core value proposition: use expensive models to create skills, then deploy those skills with cheap or local models.</p>\n<h2>How the evaluation in upskill works</h2>\n<p>upskill uses a teacher-student approach to evaluate models where the teacher model generates test cases for the student model to be evaluated on.</p>\n<ol>\n<li><strong>Teacher model</strong> (Opus) generates the skill</li>\n<li><strong>Test cases</strong> (Opus) are generated automatically from the task description</li>\n<li><strong>Student model</strong> (local) is evaluated with and without the skill</li>\n<li><strong>Skill lift</strong> measures the improvement</li>\n</ol>\n<p>If you pass an existing skill to <code>upskill eval</code>, it will generate test cases for the skill and evaluate the model on them. Test cases are simple input/output pairs that verify the agent understands the task:</p>\n<pre><code class=\"language-json\"><span class=\"code-snippet\" data-language=\"JSON\"><span class=\"syntax-source syntax-json\"><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span>\n  <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>cases<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-meta syntax-structure syntax-array syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-array syntax-begin syntax-json\">[</span>\n    <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span>\n      <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>input<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>Create a build.toml for a CUDA kernel targeting H100<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-pair syntax-json\">,</span></span>\n      <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>expected<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>contains<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>9.0<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span>\n    </span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span><span class=\"syntax-punctuation syntax-separator syntax-array syntax-json\">,</span>\n    <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span>\n      <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>input<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>Write a basic CUDA kernel template with proper includes<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-pair syntax-json\">,</span></span>\n      <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>expected<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-meta syntax-structure syntax-dictionary syntax-json\"><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-begin syntax-json\">{</span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-key syntax-json\"><span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>contains<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-meta syntax-structure syntax-dictionary syntax-value syntax-json\"><span class=\"syntax-punctuation syntax-separator syntax-dictionary syntax-key-value syntax-json\">:</span> <span class=\"syntax-string syntax-quoted syntax-double syntax-json\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-json\">&quot;</span>cuda_runtime.h<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-json\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span>\n    </span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span>\n  <span class=\"syntax-punctuation syntax-section syntax-array syntax-end syntax-json\">]</span></span>\n</span><span class=\"syntax-punctuation syntax-section syntax-dictionary syntax-end syntax-json\">}</span></span>\n</span></span></code></pre>\n<p>We can also test how a skill performs across different models:</p>\n<pre><code class=\"language-shell\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">upskill</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> eval ./skills/kernel-builder-cuda-kernels/ </span>\n    <span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">--model</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> haiku<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>m</span> kimi<span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\"> --</span>runs</span> 5</span>\n</span></span></code></pre>\n<pre><code><span class=\"code-snippet\">Evaluating kernel-builder-cuda-kernels across 2 model(s)\n  3 test case(s), 5 run(s) per model\n\nhaiku\n  Pass rate: 4/5 (80%)  Avg assertions: 2.8/3\n\nsonnet  \n  Pass rate: 5/5 (100%)  Avg assertions: 3.0/3\n\n┏━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓\n┃ Model  ┃ Pass Rate ┃ Avg Assertions ┃ Avg Tokens ┃\n┡━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩\n│ haiku  │ 4/5       │ 2.8/3          │ 1250       │\n│ kimi   │ 5/5       │ 3.0/3          │ 1890       │\n└────────┴───────────┴────────────────┴────────────┘\n</span></code></pre>\n<p>This helps you find the cost-performance sweet spot: maybe Haiku with the skill is good enough for your use case, saving significant API costs.</p>\n<h2>What's Next</h2>\n<p>We've shown that upskill can create validated skills that transfer domain expertise from powerful models to cheaper ones. The kernel-builder skill is just one example of what's possible.</p>\n<p>Some things to try:</p>\n<ul>\n<li><strong>Generate skills for your internal tools</strong></li>\n<li><strong>Build a skill library for your codebase</strong></li>\n<li><strong>Capture tribal knowledge</strong></li>\n<li><strong>Benchmark across models</strong></li>\n</ul>\n<p>The approach works for any specialized task where you'd otherwise write detailed prompts repeatedly. Skills are portable across <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://docs.anthropic.com/en/docs/claude-code\">Claude Code</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/openai/codex\">Codex</a>, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://cursor.com/docs/context/skills\">Cursor</a>, and other tools that support the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://agentskills.io\">Agent Skills specification</a>.</p>\n<h2>Resources</h2>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/upskill\">Upskill repo</a></li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://agentskills.io\">Agent Skills Specification</a></li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/kernels/tree/main/kernel-builder\">HuggingFace kernel-builder</a></li>\n</ul>\n",
  "content_markdown": "The best thing about agent skills is *upskilling* your agents on hard problems. There are two ways to look at that:\n\n1. You can take Opus 4.5 or other SOTA models and tackle the hardest problems out there.\n2. You can take models that run on your laptop and upskill them to harder problems. In this blog post, we’ll show you how to take on the latter.\n\nThis blog post walks through the process of using a new tool, `upskill`, to generate and evaluate agent skills with large models and use them with smaller models. We will benchmark `upskill` on the task of writing CUDA kernels for [`diffusers`](https://huggingface.co/docs/diffusers/en/index) models, but the process is generally useful for cutting costs, or using smaller models on hard and domain-specific problems.\n\n## What are agent skills?\n\nIn case you missed it, agent skills are taking the coding agent game by storm. In fact, they’re a straightforward concept to define model context as files, like instructions as markdown and code as scripts. The file format makes them easy to generate, share, and review. In short, they’re a practical medium to share capabilities across models and tools, and they're most useful in specific domains or hard problems. Not stuff the model can do well anyway.\n\nThis post showcases this process by using Claude to generate a Skill file that can be used by open source models for a complex and specialized task: write CUDA kernels. We first tried a simple skill based on existing documentation, and we found that it improved performance for some others, but not all. In fact, it could even degrade performance or increase token usage for some models. Check out the plot below to see the performance of the model with and without the basic skill.\n\n[![plot of model performance](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/plot.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/plot.png)\n\nNow, let's walk through how you can use `upskill` to upskill your agents on hard problems, and measure performance.\n\n## 1. Get the teacher (Claude Opus 4.5) to build a kernel\n\nFirst, we use Claude Code to build a kernel interactively and export the trace. We worked through the process by instructing, validating, and adding documentation links. This somewhat naive process is important to reveal the models' initial challenges. In fact, you can iterate on this multiple times, by trying to solve the task with draft versions of the skill, and experimenting with smaller models. Each time, you can instruct the agent to improve the skill and test it on the smaller model.\n\nHere's an [example of the skill](https://huggingface.co/hf-skills/h100-diffusers-kernel-builder) that we created and have been using to build kernels. We started from this [agent trace](https://huggingface.co/hf-skills/h100-diffusers-kernel-builder/blob/main/agent-trace.txt) where the agent was able to build a kernel, but not without some help.\n\n## 2. Make an agent skill from the trace\n\nOnce the teacher model has performed the task, we need them to make a skill. There are a number of effective ways to do this.\n\n- Within the same session, instruct the agent to create a skill file for the task it just completed.\n- Use [Anthropic ‘skill creator’ skill](https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md) either within the agent session or with an exported trace and a new agent session.\n- Use the `upskill` tool to create a skill based on the trace.\n\nIn most cases, the first 2 options result in functional skills. However, the performance of an agent with the skill is unknown. That’s where `upskill` is useful, because it will also generate test cases for your skill based on the trace. It then compares the results under both scenarios: using the trace, or applying the skill. We see below that the original model (Claude Opus) met the same performance with and without the skill. This means the skill captured the task *for this model*. Great!\n\n[![terminal evaluation](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/terminal.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/terminal.png)\n\n## 3. Take your skill to an open source, smaller, or cheaper model\n\nFinally, we need to transfer our newly created skill to the tool or model we intend to use. Most tools like `codex`, `cursor`, and `opencode` have settled on a consistent format for skills, which is a directory at `{agent}/skills/{skill_name}/SKILL.md` , so we just need to copy the skill directory to this location.\n\nWith `upskill` we can pass a skill and a set of models to the `eval` command and `upskill` will run the test cases on those models with and without the skill to compare performance. We can see here that the skill increases accuracy on some open models, but not on all.\n\n[![performance evaluation](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/accuracy.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/accuracy.png)\n\nIn this case, we might want to iterate further on the `gpt-oss` skills by regenerating the skill. We can do `upskill generate --from {skill}`.\n\nThere is more to agent skills than model performance. Often agents can reach a given accuracy with or without a skill, they just need to consume more tokens to get there. For recurring tasks, we want to optimize agents to use less tokens to achieve the same accuracy. The results below reveal another dimension to the skill. Some models are significantly reducing their performance token usage, whilst others are using more tokens **with** the skill. For example, with [`moonshotai/Kimi-K2-Thinking`](https://huggingface.co/moonshotai/Kimi-K2-Thinking) the skill is clearly effective in terms of accuracy and token usage. However, for Claude Opus 4.5 there is no clear performance increase and an increase in token usage, so you would not want to use this skill with Claude Opus 4.5.\n\n[![token usage](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/tokens.png)](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/upskill-blog/tokens.png)\n\n**tldr;** try out and evaluate models with the skills you create. Use `upskill eval` or a similar tool to evaluate the models performance with and without skills.\n\nThat’s the high level end to end of upskilling your coding agents on hard problems. Try out upskill now like this:\n\n```shell\n# install upskill\npip install upskill\n\n# or use uvx \nuvx upskill --help\n\n# generate a skill based on an agent trace\nupskill generate \"write nvidia kernels\" --from ./trace.md\n\u000b# evaluate models on a skill\nupskill eval ./skills/my-skill/ --model haiku --model sonnet\n\n# generate skills for local models\nupskill generate \"parse YAML\" \n    --model opus \n    --eval-model \"unsloth/GLM-4.7-Flash-GGUF:Q4_0\" \n    --eval-base-url http://localhost:8080/v1\n```\n\n## Deep dive tutorial into building kernels with agent skills\n\nWe have a high level understanding of how we can upskill an agent. Let’s now look at the use case we solved for writing CUDA kernels.\n\nWe didn’t just want to write kernel code, but understand the full kernel-builder workflow: project structure, `build.toml` configuration, architecture-specific optimizations, and PyTorch bindings. This tutorial shows how upskill creates validated skills that actually work.\n\nThe [`kernel-builder-cuda-kernels`](https://github.com/burtenshaw/kernel-skill) skill teaches Claude everything it needs to know about CUDA development: which GPU architecture to target, how to structure a kernel-builder project, when to use shared memory versus registers, and how to write PyTorch bindings.\n\nWith this skill, you can tell Claude things like:\n\n```\nBuild a fused LayerNorm + GELU kernel optimized for H100.\n```\n\nAnd Claude will create the complete project structure, CUDA implementation, and build configuration—following the exact conventions that kernel-builder expects.\n\nThis isn't about generating boilerplate. The skill encodes domain expertise: H100 uses compute capability 9.0, shared memory should be aligned to 128 bytes, async memory copies require `__CUDA_ARCH__ >= 900`. Knowledge that would take hours to gather from documentation gets packaged into ~500 tokens that load on demand.\n\n## Setup and Install\n\nInstall upskill:\n\n```shell\npip install upskill\n# or use uvx for one-off runs\nuvx upskill --help\n```\n\nSet your API key:\n\n```shell\nexport ANTHROPIC_API_KEY=sk-ant-...\nexport HF_TOKEN=hf_...\n```\n\nThat's it. Upskill uses Anthropic Claude Opus-4.5 model by default but also supports OpenAI and local models via OpenAI-compatible endpoints as generators. We want to use the more expensive and higher quality models to generate skills, and the smaller ones to use them. Think robin hood.\n\n## Skill Generation\n\nLet's walk through generating a skill that teaches agents how to build CUDA kernels with HuggingFace's [`kernels`](https://github.com/huggingface/kernels) library.\n\n### Generate the Skill\n\nStart with a clear task description:\n\n```shell\nupskill generate \"build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder\"\n```\n\nAbove we used upskill, but it could in fact be any agent or chat tool and an exported trace.\n\n```shell\nupskill generate \"write kernels\" --from <agent-trace>.md\n```\n\nAlso, we could start from an existing skill and add to it:\n\n```shell\nupskill generate \"add more error handling and edge cases\" \n    --from ./skills/kernel-builder-cuda-kernels/\n```\n\nupskill loads the existing skill, applies your improvements, and re-evaluates to ensure the changes help.\n\nupskill creates a skill, generates test cases, evaluates performance, and refines based on failures:\n\n```\nGenerating skill with sonnet...\nGenerating test cases...\nEvaluating on sonnet... (attempt 1)\n  60% -> 95% (+35%) OK\n\n  kernel-builder-cuda-kernels\n  Build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder.\n\n  SKILL.md              ~520 tokens\n\n  baseline   ████████████                60%\n  with skill ███████████████████    95%  (+35%)\n\nSaved to ./skills/kernel-builder-cuda-kernels\n```\n\nThe baseline shows how the model performs without any skill. The \"with skill\" result shows performance after the skill is injected into context. A 35% improvement means the skill is working.\n\nThe skill is saved as a directory following the [Agent Skills specification](https://agentskills.io):\n\n```\n./skills/kernel-builder-cuda-kernels/\n├── SKILL.md           # Main instructions (~520 tokens)\n└── skill_meta.json    # Metadata and test cases\n```\n\nOpen \\`SKILL.md\\` to see what upskill generated:\n\n```\n---\nname: kernel-builder-cuda-kernels\ndescription: Build optimized CUDA kernels for PyTorch using HuggingFace kernel-builder.\n---\n\n# Building CUDA Kernels with kernel-builder\n\n## Overview\n\nThis guide explains how to create optimized CUDA kernels for PyTorch models \nusing HuggingFace's kernel-builder. It covers project setup, kernel implementation, \nand building for specific GPU architectures like NVIDIA H100.\n\n## Project Structure\n\nproject/\n├── build.toml              # Build configuration\n├── kernel_src/             # CUDA kernel implementations\n│   ├── attention.cu\n│   ├── layernorm.cu\n│   └── geglu.cu\n└── torch-ext/              # PyTorch C++ bindings\n    └── torch_binding.cpp\n\n## Build Configuration\n\nCreate `build.toml` to define your kernel package:\n\n[general]\nname = \"diffuser_kernels\"\nbackends = [\"cuda\"]\n\n[general.cuda]\n# H100 is compute capability 9.0\ncapabilities = [\"9.0\"]\n\n...\n```\n\n### Evaluate on a Different Model\n\nThe important test is: does this skill help local or cheaper models to build kernels?\n\n```shell\n# Start a local OpenAI-compatible server with a web UI:\nllama-server -hf unsloth/GLM-4.7-Flash-GGUF:Q4_K_M\n\n# Evaluate on local model (llama.cpp server)\nupskill eval ./skills/my-skill/ \n    --model \"unsloth/GLM-4.7-Flash-GGUF:Q4_0\" \n    --base-url http://localhost:8080/v1\n```\n\n```\nGenerating skill with sonnet...\nGenerating test cases...\nEvaluating on \"unsloth/GLM-4.7-Flash-GGUF:Q4_0\"... (attempt 1)\n  40% -> 85% (+45%) OK\n\n  baseline   ████████░░░░░░░░░░░░   40%\n  with skill █████████████████░░░   85%  (+45%)\n\nSaved to ./skills/kernel-builder-cuda-kernels\n```\n\nA 45% improvement on `\"unsloth/GLM-4.7-Flash-GGUF:Q4_0\"` means the skill successfully transfers domain knowledge from a capable model to a faster, cheaper one. Skills that work on weaker models will definitely work on stronger ones.\n\nThis is the core value proposition: use expensive models to create skills, then deploy those skills with cheap or local models.\n\n## How the evaluation in upskill works\n\nupskill uses a teacher-student approach to evaluate models where the teacher model generates test cases for the student model to be evaluated on.\n\n1. **Teacher model** (Opus) generates the skill\n2. **Test cases** (Opus) are generated automatically from the task description\n3. **Student model** (local) is evaluated with and without the skill\n4. **Skill lift** measures the improvement\n\nIf you pass an existing skill to `upskill eval`, it will generate test cases for the skill and evaluate the model on them. Test cases are simple input/output pairs that verify the agent understands the task:\n\n```json\n{\n  \"cases\": [\n    {\n      \"input\": \"Create a build.toml for a CUDA kernel targeting H100\",\n      \"expected\": {\"contains\": \"9.0\"}\n    },\n    {\n      \"input\": \"Write a basic CUDA kernel template with proper includes\",\n      \"expected\": {\"contains\": \"cuda_runtime.h\"}\n    }\n  ]\n}\n```\n\nWe can also test how a skill performs across different models:\n\n```shell\nupskill eval ./skills/kernel-builder-cuda-kernels/ \n    --model haiku --m kimi --runs 5\n```\n\n```\nEvaluating kernel-builder-cuda-kernels across 2 model(s)\n  3 test case(s), 5 run(s) per model\n\nhaiku\n  Pass rate: 4/5 (80%)  Avg assertions: 2.8/3\n\nsonnet  \n  Pass rate: 5/5 (100%)  Avg assertions: 3.0/3\n\n┏━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓\n┃ Model  ┃ Pass Rate ┃ Avg Assertions ┃ Avg Tokens ┃\n┡━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩\n│ haiku  │ 4/5       │ 2.8/3          │ 1250       │\n│ kimi   │ 5/5       │ 3.0/3          │ 1890       │\n└────────┴───────────┴────────────────┴────────────┘\n```\n\nThis helps you find the cost-performance sweet spot: maybe Haiku with the skill is good enough for your use case, saving significant API costs.\n\n## What's Next\n\nWe've shown that upskill can create validated skills that transfer domain expertise from powerful models to cheaper ones. The kernel-builder skill is just one example of what's possible.\n\nSome things to try:\n\n- **Generate skills for your internal tools**\n- **Build a skill library for your codebase**\n- **Capture tribal knowledge**\n- **Benchmark across models**\n\nThe approach works for any specialized task where you'd otherwise write detailed prompts repeatedly. Skills are portable across [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Codex](https://github.com/openai/codex), [Cursor](https://cursor.com/docs/context/skills), and other tools that support the [Agent Skills specification](https://agentskills.io).\n\n## Resources\n\n- [Upskill repo](https://github.com/huggingface/upskill)\n- [Agent Skills Specification](https://agentskills.io)\n- [HuggingFace kernel-builder](https://github.com/huggingface/kernels/tree/main/kernel-builder)\n",
  "dateCreated": "2026-10-04T12:50:30.804479567+00:00",
  "date_created": "2026-01-28T00:00:00+00:00",
  "date_modified": "2026-01-28T00:00:00+00:00",
  "date_published": "2026-01-28T00:00:00+00:00",
  "description": "The best thing about agent skills is upskilling your agents on hard problems. There are two ways to look at that: You can take Opus 4.5 or other SOTA models and tackle the hardest problems out there. You can take models that run on your…",
  "external_url": "https://huggingface.co/blog/upskill",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/huggingface-co/2026/01/2026-01-28-we-got-claude-to-build-cuda-kernels-and-teach-open-models.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/huggingface-co/2026/01/2026-01-28-we-got-claude-to-build-cuda-kernels-and-teach-open-models.md"
  },
  "id": "urn:aggr:item:40db5752a2df1fab8a1adc0f577066501555995f",
  "isBasedOn": {
    "@id": "https://huggingface.co/blog/upskill"
  },
  "mainEntity": {
    "@id": "https://huggingface.co/blog/upskill",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-01-28-we-got-claude-to-build-cuda-kernels-and-teach-open-models/#webpage"
    },
    "dateModified": "2026-01-28T00:00:00+00:00",
    "datePublished": "2026-01-28T00:00:00+00:00",
    "headline": "We Got Claude to Build CUDA Kernels and teach open models!",
    "timeRequired": "PT10M",
    "url": "https://huggingface.co/blog/upskill",
    "wordCount": 2070
  },
  "name": "Archived snapshot: We Got Claude to Build CUDA Kernels and teach open models!",
  "preview": null,
  "reading_minutes": 10,
  "replicated_at": null,
  "source": "huggingface-co",
  "source_name": "Hugging Face - Blog",
  "summary": null,
  "tags": [],
  "temporalCoverage": "2026-10-04T12:50:30.804479567+00:00",
  "title": "We Got Claude to Build CUDA Kernels and teach open models!",
  "url": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-01-28-we-got-claude-to-build-cuda-kernels-and-teach-open-models/",
  "word_count": 2070
}