惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Y
Y Combinator Blog
P
Palo Alto Networks Blog
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
B
Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
Cisco Talos Blog
Cisco Talos Blog
IT之家
IT之家
Engineering at Meta
Engineering at Meta
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
F
Fortinet All Blogs
Jina AI
Jina AI
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
GbyAI
GbyAI
L
LangChain Blog
P
Privacy International News Feed
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
Project Zero
Project Zero
TaoSecurity Blog
TaoSecurity Blog
A
About on SuperTechFans
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
G
GRAHAM CLULEY
I
InfoQ
K
Kaspersky official blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
博客园_首页
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
I
Intezer
博客园 - 聂微东

Modular Blog

Qualcomm to Acquire Modular Modular 26.4: SOTA MoE Serving, Model Bringup via Agent Skills, Mojo 1.0 Beta 2 and More ModCon 2026: Modular’s Developer Conference Day Zero: MiniMax M3 Open Weights on Modular Cloud Modverse #55: Mojo 1.0 Beta, Community Mojo Libraries, and Real-Time Patient Conversations Powered by MAX What about OpenCL and CUDA C++ alternatives? (Democratizing AI Compute, Part 5) Why LLM Inference Needs a New Kind of Router - Part 3 Three trends from MLSys 2026 Why LLM Inference Needs a New Kind of Router - Part 2 How I built a pure Mojo app (and 10 libraries) with AI agents Hippocratic AI partners with Modular to power flexible, high-quality inference for real-time patient conversations Translating to Mojo via AI Agents Inkwell: Why Your Inference Platform Matters As Much As Your Model Why LLM Inference Needs a New Kind of Router - Part 1 Modular 26.3: Mojo 1.0 Beta, MAX Video Gen, and more Modverse #54: AMD AI DevDay, New Modular Offices, and a Community That Keeps Shipping How Frontier Coding Agents Built a Video Diffusion Pipeline on MAX TileTensor Part 1 - Safer, More Efficient GPU Kernels Modular Opens Edinburgh & San Francisco Offices Structured Mojo Kernels Part 4 - Portability and the Road Ahead Day Zero Launch: Fastest Performance for Gemma 4 on NVIDIA and AMD Modverse #54: From GTC to Edinburgh, a Community Building Momentum Software Pipelining for GPU Kernels: Part 1 - The Pipeline Problem Structured Mojo Kernels Part 3 - Composition in Practice Modular 26.2: State-of-the-Art Image Generation and Upgraded AI Coding with Mojo Modular at NVIDIA GTC 2026: MAX on Blackwell, Mojo Kernel Porting, and DeepSeek V3 on B200 Structured Mojo Kernels Part 2 - The Three Pillars Modverse #53: Community Builds, Research Milestones, and a Growing Ecosystem Structured Mojo Kernels Part 1 - Peak Performance, Half the Code The Claude C Compiler: What It Reveals About the Future of Software BentoML Joins Modular The Five Eras of KVCache Modular 26.1: A Big Step Towards More Programmable and Portable AI Infrastructure How to Beat Unsloth's CUDA Kernel Using Mojo—With Zero GPU Experience 🔥 Modular 2025 Year in Review The path to Mojo 1.0 Modverse #52: Advancing AI Together — Community Projects & Platform Milestones Modular 25.7: Faster Inference, Safer GPU Programming, and a More Unified Developer Experience "TTS 1 Max" (powered by Modular Platform) Ranked #1 Speech Model on Artificial Analysis PyTorch and LLVM in 2025 — Keeping up With AI Innovation Achieving State-of-the-Art Performance on AMD MI355 — in Just 14 Days Modular Raises $250M to scale AI's Unified Compute Layer Modular 25.6: Unifying the latest GPUs from NVIDIA, AMD, and Apple Matrix Multiplication on Blackwell: Part 4 - Breaking SOTA Modverse #51: Modular x Inworld x Oracle, Modular Meetup Recap and Community Projects Matrix Multiplication on Blackwell: Part 3 - The Optimizations Behind 85% of SOTA Performance Matrix Multiplication on Blackwell: Part 2 - Using Hardware Features to Optimize Matmul Matrix Multiplication on Blackwell: Part 1 - Introduction Modverse #50: Modular Platform 25.5, Community Meetups, and Mojo's Debut in the Stack Overflow Developer Survey Modular Platform 25.5: Introducing Large Scale Batch Inference SF Compute and Modular Partner to Revolutionize AI Inference Economics AI Agents for AWS Marketplace Modverse #49: Modular Platform 25.4, Modular 🤝 AMD, and Modular Hack Weekend Inside Modular Hack Weekend: Top Projects and Community Highlights How is Modular Democratizing AI Compute? (Democratizing AI Compute, Part 11) Modular 25.4: One Container, AMD and NVIDIA GPUs, No Lock-In Introducing Mammoth: Enterprise-Scale GenAI Deployments Made Simple Modular + AMD: Unleashing AI performance on AMD GPUs Modverse #48: Modular Platform 25.3, MAX AI Kernels, and the Modular GPU Kernel Hackathon Exploring Metaprogramming in Mojo Modular GPU Kernel Hackathon Highlights: Innovation, Community, & Mojo🔥 Modular’s bet to break out of the Matrix (Democratizing AI Compute, Part 10) Modular Platform 25.3: 450K+ Lines of Open Source Code and pip Packaging A New, Simpler License for MAX and Mojo Why do HW companies struggle to build AI software? (Democratizing AI Compute, Part 9) Modverse #47: MAX 25.2 and an evening of GPU programming at Modular HQ What about the MLIR compiler infrastructure? (Democratizing AI Compute, Part 8) What about Triton and Python eDSLs? (Democratizing AI Compute, Part 7) MAX 25.2: Unleash the power of your H200's–without CUDA! What about TVM, XLA, and AI compilers? (Democratizing AI Compute, Part 6) Modverse #46: MAX 25.1, MAX Builds, and Democratizing AI Compute CUDA is the incumbent, but is it any good? (Democratizing AI Compute, Part 4) MAX 25.1 - Introducing MAX Builds How did CUDA succeed? (Democratizing AI Compute, Part 3) Paged Attention & Prefix Caching Now Available in MAX Serve What exactly is “CUDA”? (Democratizing AI Compute, Part 2) Modular DeepSeek's Impact on AI (Democratizing AI Compute, Part 1) Modular Hands-on with Mojo 24.6 Evaluating Llama Guard with MAX 24.6 and Hugging Face Modular Introducing MAX 24.6: A GPU Native Generative AI Platform MAX GPU: State of the Art Throughput on a New GenAI platform Understanding SIMD: Infinite Complexity of Trivial Problems Hands-on with Mojo 24.5 MAX 24.5 - With SOTA CPU Performance for Llama 3.1 Announcing stack-pr: an open source tool for managing stacked PRs on GitHub Debugging in Mojo🔥 Write hardware-agnostic custom ops for PyTorch | Modular Take control of your AI Develop locally, deploy globally A brief guide to the Mojo n-body example What's new in MAX 24.4? MAX on macOS, fast local Llama3, native quantization and GGUF support What’s new in Mojo 24.4? Improved collections, new traits, os module features and core language enhancements MAX 24.4 - Introducing quantization APIs and MAX on macOS Deep dive into ownership in Mojo What ownership is really about: a mental model approach Fast⚡k-means clustering in Mojo🔥: a guide to porting Python to Mojo🔥 for accelerated k-means clustering
Community Spotlight: Writing Mojo with Cursor
No items found. · 2024-10-10 · via Modular Blog

As a new and self-taught programmer, complicated syntax has never been my friend. Python was one of the first languages I tried, and I loved it immediately for its readable, simple syntax. It felt almost like writing English. When I stumbled upon Mojo, it seemed like the best of both worlds, combining Python’s straightforward syntax with the performance of compiled languages like Rust and C. Still, I looked for a way to speed up my learning process so that I could focus less on syntax and more on building.

Not long after discovering Mojo, I came across a LinkedIn post about Cursor, an AI-powered code editor that was built as a fork of Visual Studio Code. I was blown away by how fast I could build when I wasn’t constrained by my lack of syntactic mastery, or by going back and forth between a code editor and the browser to use ChatGPT. 

Was the generated code perfect? No, but it was a great starting point for me to iterate on, and Cursor fundamentally changed the way that I learn new programming languages. This paradigm shift isn’t unique to Cursor; GitHub Copilot and other AI-powered IDE plugins have changed the way that people program and learn to program. I was excited to use Cursor to write Mojo, but I quickly realized that doing so would be difficult – because Mojo is a new, still-evolving language, most large language models struggle to write correct Mojo that will compile and run using the latest release.

Instead of giving up and writing Mojo the old-fashioned way, I decided to take on this challenge as a learning experience. My mission was simple: help AI write better Mojo.

My first attempt at using AI to write Mojo

The first time I tried to write Mojo with Cursor, I used one of their default models: Anthropic’s Claude 3.5 Sonnet. This model’s training data cuts off in April 2024, meaning that there are five months of Mojo updates missing from its training set. To test the model’s Mojo-writing abilities, I gave Cursor a simple task: “Write a Mojo script to output the sum of two values”:

Mojo

fn main():   let a: Int = 5   let b: Int = 7   let sum = a + b   print("The sum of", a, "and", b, "is:", sum) main()

There were two things I noticed about the generated snippet:

  1. It used let statements. Early in its evolution, Mojo supported both let and var statements. At one point in time, this would have been correct Mojo, but support for let statements was removed earlier this year.
  2. Although every Mojo program must include a function named main() as its entry point, the code in the main() function will run without explicitly calling main(), so the last line of the generated snippet is unnecessary.

Overall, the performance in this case was okay, but not great. If I were grading Cursor and Sonnet’s Mojo writing skills, I would have graded it a C at this point.

Turning to ChatGPT for advice

I needed to improve Cursor’s Mojo writing abilities, and the internet is full of recommended techniques to make AI more accurate – from RAG (and graph RAG), to fine-tuning, to prompt engineering. I was overwhelmed by the choices, so I turned to ChatGPT for advice, feeding it an example of the semi-correct Mojo code generated and asking how I could get better performance. ChatGPT’s recommendation? Fine-tune a model using data specific to the Mojo standard library.

Given that this was my first foray into fine-tuning, I kept it simple and used OpenAI’s dashboard. I put ChatGPT to work again by providing it with Mojo’s documentation and asking it to generate training data. 

__wf_reserved_inherit

OpenAI's fine-tuning dashboard

After fine-tuning the model with this data and setting Cursor to use the resulting model, I gave Cursor the same prompt: “Write a Mojo script to output the sum of two values”:

Mojo

fn sum(a: Int, b: Int) -> Int:   return a + b print(sum(3, 5))

This answer was an improvement, but I noticed one glaring issue with the generated code: the call to print(sum(3, 5)) wasn’t inside a main() function, so running this code would result in the following error:

Mojo

error: TODO: expressions are not yet supported at the file scope level print(sum(3, 5)) ^ mojo: error: failed to parse the provided Mojo source module

The code was otherwise correct. Once I put print(sum(3, 5)) inside a main() function, the script ran and returned 8 as the sum of 3 and 5. I also wanted to test whether fine-tuned GPT4o’s knowledge of Mojo variable syntax was any better than Claude 3.5 Sonnet’s, so I gave Cursor another command: “Use variables.” In response, Cursor updated my script:

Mojo

fn sum(a: Int, b: Int) -> Int:   return a + b fn main():   var num1: Int = 3   var num2: Int = 5   print(sum(num1, num2))

This syntax is correct! Overall, I’d grade Cursor and my fine-tuned GPT-4o a B when it comes to writing Mojo.

I also wanted to test whether regular GPT-4o was aware that let is no longer supported by Mojo. To do so, I switched over to the base model and asked Cursor to “write a Mojo script to output the sum of two values”:

Mojo

struct Adder:   fn add(a: Int, b: Int) -> Int:      return a + b fn main()   let adder = Adder()   let result = adder.add(5, 7)   print("The sum is: \(result)") main()

This result was clearly worse than what fine-tuned GPT-4o generated: it reverted back to the outdated let syntax, added an unnecessary call to main() at the end, and overcomplicated the solution by creating the add() function as part of a struct. This gave me confidence that fine-tuning GPT4o using data generated from Mojo’s documentation had significantly improved the model’s Mojo skills.

My takeaways and next steps

Although GPT-4o wrote passable Mojo in Cursor after fine-tuning on the Mojo docs, I’m continuing to experiment with techniques to improve performance. For my latest iteration, I’ve created a JSON file containing all the Mojo-related resources I’ve been able to find on the web, including documentation, blog posts, code snippets, and tutorials. I wrote a script that feeds this file to GPT-4o and asks the model to generate a set of questions related to Mojo, acting as a user trying to learn Mojo. My script then uses OpenAI’s new o1-preview model to answer the questions generated by GPT-4o, using the resources in the JSON file. o1-preview seems to do a better job of reasoning through multiple steps and avoiding hallucination in its answers.

I plan to continue scaling this dataset, and then use the larger dataset to fine-tune GPT-4o again. I’ll hopefully use this fine-tuned model to create an even larger dataset of Mojo questions and answers. Finally, I’ll fine-tune an open source model like Llama 3 on my resulting Mojo dataset, unleashing the ultimate model to enable myself and other Mojicians to write better Mojo. This is just the beginning for my journey with Mojo and AI, and I can’t wait to see what the future holds.

Have you used AI to write Mojo? Did you discover any tips or tricks along the way? Any advice for me on my journey to create the ultimate Mojo model? Join the conversation in Modular’s Discord server.