Skip to content

[New Feature] Full support for Python 3.14(No GIL) #61

@JohnRichard4096

Description

@JohnRichard4096

中文用户?

  • 我是一个中文用户,并且我明白需要使用英语编写Issue

What new feature/improvement

Add a dedicated CI test matrix entry for Python 3.14 running in free-threading mode (PYTHON_GIL=0).

Background

AmritaCore currently supports Python 3.10–3.15, and the README explicitly mentions Python 3.14+ free-threading as an Unstable Feature:

Python 3.14+ Supporting: we are not sure if it will work well on Python 3.14+ (No GIL Version).

This uncertainty should be resolved through automated testing.

Motivation

  • Free-threading fundamentally changes CPython's concurrency model—AmritaCore uses asyncio, aiologic, and anyio extensively, and we need to verify thread safety under free-threading.
  • Downstream users running CPU-bound AI workloads (token counting, tool execution, embedding generation) may benefit from true parallelism and need confidence that the framework is compatible.
  • Early detection of breakage in third-party dependencies (aiohttp, openai, anthropic, jieba, filetype, etc.).

Proposed Implementation

Add a dedicated matrix entry in the CI.

When no-gil: true:

  • Set PYTHON_GIL=0 environment variable before running tests.
  • Use python3.14t interpreter or python3.14 -X gil=0.
  • Run the full test suite.

Acceptance Criteria

  • A CI job named "Python 3.14 (free-threading)" runs on every PR and push to main.
  • All existing tests pass under free-threading, or known incompatibilities are explicitly documented with pytest.mark.xfail / pytest.skip.
  • The job runs in parallel with the existing matrix and does not significantly increase CI completion time.

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions