What is ChatGPT coded in?
By SkillzBench · October 16, 2026
What is ChatGPT coded in? OpenAI has never said officially. We break down the Python, C++, Triton and PostgreSQL evidence behind ChatGPT's tech stack.
Key Facts
- OpenAI has never officially named the programming languages behind ChatGPT, describing its models only as weights and parameters plus code.
- The widely reported answer is that ChatGPT is primarily built in Python, with C++ providing the muscle.
- OpenAI built Triton, its own Python-based GPU programming language, signaling a Python-first engineering culture.
- OpenAI researchers wrote FP16 matrix multiplication kernels matching cuBLAS performance in under 25 lines of Triton code.
- Triton kernels ran up to 2x more efficiently than equivalent Torch implementations.
- ChatGPT's data layer reportedly runs on Azure PostgreSQL with roughly 50 read replicas handling millions of queries per second.
- PgBouncer on Kubernetes pools ChatGPT's database connections because Azure PostgreSQL caps connections at 5,000.
The Short Answer: Why ChatGPT's Language Stack Is a Mystery
Ask five developers what ChatGPT is coded in and you'll get five confident answers — but here's the twist: OpenAI has never officially published the languages behind its flagship product.
The widely reported answer is that ChatGPT is primarily built in Python, supported by C++, deep learning frameworks, and large-scale infrastructure software — the framing being "Python is the brain, C++ is the muscle," according to a widely circulated technical explainer. But that reporting is secondary. OpenAI's own documentation describes its models only as "weights" or "parameters" plus code that interprets them, and OpenAI's Help Center never names a single programming language.
Why the secrecy — or at least the silence? Because the question itself is misleading. ChatGPT isn't one codebase you can point at. It's a layered system:
- Model weights — billions of learned parameters, not "code" in any traditional sense
- Training and inference code that turns those weights into responses
- Serving infrastructure — databases, connection pooling, and orchestration keeping the product online for millions of users
The strongest primary evidence for OpenAI's Python-centric engineering isn't about ChatGPT directly — it's Triton, OpenAI's own open-source, Python-based GPU programming language. OpenAI researchers wrote FP16 matrix multiplication kernels matching cuBLAS performance in under 25 lines of Triton code, with some kernels running up to 2x more efficiently than equivalent Torch implementations, as detailed in Open's own Triton announcement. A company that builds its own Python-based GPU language is, reasonably, a Python-first company.
On the infrastructure side, the production story is equally multi-language and multi-system: ChatGPT's data layer reportedly runs on PostgreSQL on Azure with roughly 50 read replicas handling millions of queries per second, plus Azure Cosmos DB for write-heavy workloads, with PgBouncer on Kubernetes managing connections — details surfaced in a vendor analysis of OpenAI's architecture.
The practical takeaway for anyone building with AI: you don't need OpenAI's stack to work effectively with its models. Most practitioners interact with ChatGPT through prompts, APIs, and agent workflows — and if you're assembling agents, free resources like SkillzBench's directory of security-scanned agent skills can do more for your results than knowing whether the backend is Python or C++.
The Strongest Evidence: OpenAI Built Its Own Python-Based GPU Language
If you want to know what language ChatGPT's engineers actually think in, the best publicly available clue isn't a leaked codebase — it's a language OpenAI built itself. In 2021, OpenAI released Triton, an open-source, "Python-like programming language" for writing GPU code, described by its developer Philippe Tillet as enabling researchers with no CUDA experience to produce highly efficient kernels "most of the time on par with what an expert would be able to produce" (OpenAI).
That decision says a lot. Rather than adopting an existing GPU language wholesale, OpenAI invested in a tool whose source code is decorated Python, compiled down to run on NVIDIA hardware. According to InfoWorld, Triton uses Python 3.6 and up as its base and JIT-compiles that code directly to the GPU. The @triton.jit decorator marks the functions that get compiled, and Triton's libraries deliberately resemble NumPy — a design choice InfoQ reporting ties to Python being "currently the biggest destination for developing machine-learning solutions."
Under the hood, the compiler pipeline is genuinely Python-centric: it starts from the AST of a Python function and passes through Triton-IR, an LLVM-based intermediate representation, before emitting PTX for NVIDIA GPUs (OpenAI). Triton also automates optimizations that CUDA developers must handle manually, including memory coalescing, shared memory management, and intra-SM scheduling.
The performance results make the story more than a convenience play:
- OpenAI researchers wrote FP16 matrix multiplication kernels matching cuBLAS performance in under 25 lines of Triton code.
- Those researchers produced kernels up to 2x more efficient than equivalent Torch implementations.
- Triton's fused softmax keeps rows in SRAM (roughly under 32K columns), while PyTorch's internal CUDA code uses temporary memory and runs slower.
For a company to build its own Python-based language for the exact kind of GPU work that powers large language models is strong, primary-source evidence that OpenAI's machine-learning engineering is Python-centric — even though OpenAI has never officially published ChatGPT's full language stack. Its Help Center describes models only as weights and parameters "along with code that interprets and uses those numbers," without naming languages.
The layered lesson matters for anyone building with AI today: modern systems like ChatGPT are stacks, not single codebases — Python-level ML logic on top, compiled GPU kernels underneath, and database infrastructure below that. You don't need OpenAI's stack to build your own agents, though. Agent skills let you extend the tools you already use, and SkillzBench is building a free directory where every skill is security-scanned and benchmarked, plus a free MCP connector to equip your agents — with the waitlist currently open.
Beyond the Code: The Database and Infrastructure Behind Millions of Queries
When you type a question into ChatGPT, your words don't land in a single tidy program — they hit a distributed data layer serving millions of queries per second. Understanding that layer reveals as much about how ChatGPT works as any programming language does.
According to a detailed analysis of OpenAI's published infrastructure write-up, ChatGPT's production database layer runs on a single primary Azure PostgreSQL Flexible Server backed by roughly 50 full read replicas distributed globally. Together, these replicas handle millions of queries per second for both ChatGPT and the OpenAI API. Write-heavy, shardable workloads were migrated to Azure Cosmos DB, with the two systems stitched together at the application level.
The scale creates problems most databases never face. Azure PostgreSQL caps connections at 5,000, so OpenAI runs PgBouncer on Kubernetes to pool connections across its fleet. The standard Azure Flexible Server limit is just five read replicas, meaning OpenAI needed custom arrangements — including cascading replication — to reach its ~50-replica topology. The reported results are impressive: double-digit millisecond p99 client-side latency, claimed five-nines availability, and reportedly only one SEV-0 PostgreSQL incident in the past year.
Not everyone admires the design. Matthew Penaroza, writing for SurrealDB — a company that sells a competing distributed database, and who openly discloses "they pay me, so I'm biased" — calls the architecture "a lesson in what not to do." His argument: "I wouldn't eat soup with a fork, and I wouldn't use a single-writer PostgreSQL cluster to serve 800 million users," and he contends that modern distributed databases solve these problems out of the box. He also speculates, explicitly labeling it suspicion rather than fact, that Microsoft's stake in OpenAI influenced the choice of Azure services. Treat that critique as an interested vendor's opinion, not settled engineering truth — though his observation that ~50 replicas means 50 full dataset copies, with substantial CPU capacity likely idle most of the time, is a fair prompt to think about overprovisioning at scale.
The takeaway for anyone building with AI today is that modern AI products are layered stacks, not single applications:
- ML code in Python-style tooling, compiled down to GPU kernels
- Serving infrastructure tuned for memory bandwidth and token throughput
- A globally distributed data layer with read replicas, connection pooling, and separate write stores
If you're an agent builder, you don't need OpenAI's budget to benefit from the same principle: match each layer to the right tool. SkillzBench is building exactly that kind of matching for the skills layer — a free directory where agent skills are security-scanned, version-pinned, and benchmarked for measurable lift, with a free MCP connector to equip the agents you choose. The waitlist is open now.
What This Means for Your Own AI Stack
Here's the practical takeaway most articles skip: you don't need OpenAI's stack to build something useful with AI. ChatGPT runs on a layered architecture — Python-centric ML code, custom GPU kernels, and a production database tier with roughly 50 read replicas handling millions of queries per second. Almost nobody building agents today needs to reproduce any of that.
What you actually need is the right layer of abstraction. OpenAI itself proved the point with Triton, its open-source GPU programming language, which lets researchers write kernels that match expert CUDA performance in under 25 lines of code. The lesson generalizes: the winning move is standing on a well-designed layer, not rebuilding the layers underneath it.
For agent builders, that accessible layer is agent skills — instruction packages (SKILL.md format) that plug into Claude Code, Codex, Cursor, Gemini CLI, and chat-app agents. Instead of writing GPU kernels or standing up Postgres clusters, you compose existing skills to give your agent new capabilities in minutes.
The catch is trust. Skills are everywhere, and published research has found roughly 26% carry at least one vulnerability. Adopting the wrong one isn't just unhelpful — it can be a security risk.
That's the gap SkillzBench is being built to close. Its free directory will crawl and deduplicate skills from GitHub, then verify each one before it reaches your agent:
- Version pinning to a commit SHA, plus license and quality checks
- Security scanning so vulnerable skills get flagged, not silently installed
- Sandbox benchmarking — every skill tested with and without itself, so you see the actual Lift it adds
- A free MCP server that connects any agent to only the skills you toggle on, per agent
The model is deliberately clean: everything on the platform is free, and money never touches scores or listings. Lift is always shown separately from the trust score so you can judge security and performance on their own terms.
If you're building with AI, take the layered-stack lesson seriously. Pick a strong model, pick verified skills, and let someone else worry about the inference infrastructure. SkillzBench is pre-launch with a waitlist open now — skills, proven, is exactly what it's here to deliver.
Frequently Asked Questions
What programming language is ChatGPT actually written in?
How do we know OpenAI is a Python-first company if they won't confirm it?
Is ChatGPT really just one big program written in one language?
What database and infrastructure does ChatGPT run on?
Does Triton actually perform as well as expert CUDA code?
Do I need to know OpenAI's exact tech stack to build things with AI?
Key Takeaways
{ "title": "The Stack Doesn't Matter — The Layer You Stand On Does", "content": "So, what is ChatGPT coded in? The honest answer: probably Python at the core, with C++ and massive infrastructure underneath — but OpenAI has never officially confirmed it. What we do know is more interesting: OpenA