Back to stack index

Language

Python

Default for RAG services, eval tools, and many agents.

Short answer

Python is the main language of AI. It is used for model training, inference libraries, data pipelines and most agent and RAG frameworks, and in our directory it powers Dify's back end, Langflow, Browser Use, Skyvern, Letta, Mem0, LiteLLM, Aider and OpenHands. The current release is Python 3.15.1, from October 21, 2026, an expedited security release that followed Python 3.15.0 on October 9 and updated the bundled pip to 26.2.2 after a certificate authority incident. Python is free under the Python Software Foundation License. For self-hosting, Python projects usually arrive as Docker images, so the language matters mainly when you install from source, where version mismatches and dependency conflicts are the most common problems. The uv package manager has become the standard way to avoid those problems in new AI projects.

Latest release
Python 3.15.1, October 21, 2026
python.org
Python 3.15.0
October 9, 2026
python.org
License
PSF License v2
python.org
Common package manager
uv
Astral

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (9)

  • Dify

    Visual builder for RAG apps and agents with deployable API endpoints.

  • Langflow

    Node editor for LangChain-style flows exportable as Python or API.

  • Browser Use

    Library for letting models drive a real browser session step by step.

  • Skyvern

    Vision-guided browser workflows when DOM selectors break every week.

  • Letta

    Stateful agents that retain context and learn preferences over time.

  • Mem0

    Memory layer that stores facts about users and retrieves them into prompts.

  • LiteLLM

    OpenAI-compatible proxy that unifies dozens of model providers behind one key.

  • Aider

    Aider pairs with local or remote models inside editors and terminals you trust.

  • OpenHands

    OpenHands pairs with local or remote models inside editors and terminals you trust.

Python in open-source AI tools: the language behind RAG platforms, agents and gateways in 2026

Why AI runs on Python

Python became the language of machine learning in the 2010s through NumPy, scikit-learn and then PyTorch and TensorFlow. Its syntax is easy for researchers, it interoperates well with C, C++ and CUDA code that does the heavy maths, and Jupyter notebooks made it the default for experiments. When large language models arrived, the libraries for loading, fine-tuning and serving them were Python, and so were the first agent and RAG frameworks, LangChain and LlamaIndex, both released in 2022.

The result is that most open-source AI back ends in 2026 are Python services: they receive requests from a web front end, call a model through an API or a local runtime, retrieve documents from a vector database, and return results.

Which directory projects use it

ProjectWhat it isPython's role
DifyLLM app platformAPI server and workers (Flask, Celery); front end is Next.js
LangflowVisual flow builderFastAPI back end and components; React front end
Browser UseBrowser automation for agentsLibrary built on Playwright
SkyvernBrowser workflow automationFastAPI service with vision models
LettaAgents with long-term memoryServer and SDK
Mem0Memory layer for AI appsLibrary and server
LiteLLMModel gatewaySDK and FastAPI proxy
AiderTerminal coding agentEntire tool
OpenHandsAutonomous coding agentAgent server and runtime

Extending any of these, such as writing a custom Dify tool, a Langflow component or a Browser Use action, means writing Python.

Python 3.15

Python 3.15.0 was released on October 9, 2026, following the annual October schedule. Changes that matter for AI projects include:

  • Lazy imports. PEP 810 adds explicit lazy imports, so a module is loaded only when first used. AI libraries import large packages such as PyTorch, and lazy imports can cut command-line startup from seconds to a fraction of a second.
  • UTF-8 by default. PEP 686 makes UTF-8 the default text encoding on every platform, removing a long-standing source of errors when reading documents on Windows.
  • Profiling. A new low-overhead sampling profiler helps find slow code in long-running services.

Python 3.15.1 followed on October 21, 2026, as an expedited security and maintenance release. It upgraded the bundled pip to 26.2.2 in response to the eMudhra/emSign certificate authority incident, which led several software vendors in October to remove trust for certificates from a compromised intermediate authority.

Python 3.14, released in October 2025, made the free-threaded build, which runs without the global interpreter lock, officially supported. Free-threaded Python lets CPU-heavy Python code use multiple cores in one process. For AI services it helps preprocessing, tokenization and data loading; many native libraries now publish free-threaded builds, but check compatibility before switching.

Which version to run

VersionStatus in October 2026Advice
3.15Newest, bug fixesWait for your libraries to support it
3.14Bug fixesGood for new projects if dependencies support it
3.13Security fixesSafe, widely supported
3.12Security fixesSafest for older AI libraries
3.10 and 3.11Security fixes until 2026 and 2027Plan to upgrade

AI libraries with compiled extensions, such as PyTorch, often support a new Python release a few months after it ships. Check the project's pyproject.toml for its requires-python setting before choosing.

Packaging with uv

Dependency conflicts were the single biggest headache in Python AI projects: two libraries pinned different versions of the same dependency, CUDA builds of PyTorch needed special index URLs, and installs took minutes. uv, from Astral, released in 2024, addressed much of this. It resolves and installs dependencies many times faster than pip, writes a lock file for reproducible installs, manages Python versions itself, and handles PyTorch's CUDA-specific indexes through configuration.

A typical install of a Python AI tool from source now looks like:

uv sync
uv run python -m app

Aider, Browser Use and many other projects document uv tool install or uvx to run them without touching the system Python.

What it means for self-hosting

  • Docker is easiest. Python projects with many dependencies are far simpler to run as containers. Dify, Langflow and LiteLLM all publish official images.
  • Workers and queues. Python back ends often split into an API process and background workers using Celery or a similar queue with Redis. Scale workers separately.
  • Memory. A Python worker that loads an embedding model or tokenizer can use 1 to 4 GB. Count workers carefully on small servers.
  • GPU builds. If a project runs models locally, install the CUDA build of PyTorch that matches your driver. The CPU build installs by default on many systems and runs very slowly.
  • Supply chain. PyPI has seen malicious uploads, including the compromised LiteLLM releases of March and October 2026. Pin versions, use lock files, and prefer official images.

Notebooks and scripts

Much AI work in Python starts in a Jupyter notebook: loading a dataset, trying prompts, measuring retrieval quality. Projects such as Langflow and Dify let you prototype visually and then export or call flows from Python scripts. When a notebook experiment becomes a service, move the code into a package with tests and a lock file before deploying it, since notebooks hide state and run cells out of order.

Async web frameworks

Python AI services mostly use FastAPI or Flask for HTTP, and Django for full applications with admin panels. FastAPI's async support suits model calls, which spend most of their time waiting on network responses, and its Pydantic models validate structured output from language models.

Python compared with TypeScript and Go

ConcernPythonTypeScriptGo
AI and ML librariesMost extensiveGrowingFew
Web front endSeparateNativeSeparate
Single binary deploysNoNoYes
ConcurrencyAsync, free-threaded buildsEvent loopGoroutines
Typical AI useBack ends, agents, RAG, researchChat UIs, product appsRuntimes, gateways, infra

Contributing

Python AI projects typically use Ruff for linting and formatting, pytest for tests, and either uv or Poetry for dependencies. Many tests call model APIs; look for a mock or recorded-response mode so you can run the suite without paying for tokens. Type hints are common and checked with mypy or Pyright. Start with an issue labelled "good first issue", and run the formatter before pushing, since most projects enforce it in CI.

Related: FastAPI stack, Django stack, TypeScript stack, Hugging Face stack, Playwright stack, Stack index.

Frequently asked questions

Why is Python used for AI?

PyTorch, JAX, Hugging Face Transformers, NumPy and almost every research library are Python-first, so models are trained, evaluated and often served from Python. Agent and RAG frameworks followed, because their authors already worked there. Python's slow interpreter matters little when the heavy work runs on GPUs in C++ and CUDA.

Which Python version should I use for AI projects?

Use the version the project's documentation names, usually stated in pyproject.toml. Many AI libraries take a few months to support a new Python release, so in late 2026 Python 3.12 and 3.13 are the safest choices for compatibility, with 3.14 widely supported and 3.15 still being adopted.

What is uv?

uv is a fast Python package and project manager from Astral, written in Rust. It installs Python versions, creates virtual environments, resolves and locks dependencies, and runs scripts, replacing pip, pip-tools, pyenv and virtualenv for most uses. Many AI projects now document uv as the install method.

Do I need Python to self-host Dify or Langflow?

Not if you use Docker, which both projects recommend. Python matters if you install from source, write custom components or tools, or contribute code.

Is Python too slow for production AI services?

For most AI services, no. Time is dominated by model inference, which runs in optimized native code, and by network calls to model APIs. Python async frameworks such as FastAPI handle many concurrent requests. Where overhead matters, projects move hot paths to Rust or Go, as LiteLLM has done for some components.

Sources

  1. Python downloads
  2. What's new in Python 3.15
  3. uv documentation
  4. Python release status