Skip to main content

AI-Cortex

An agentic CLI coding assistant powered entirely by local LLMs via Ollama.

AI-Cortex gives you an agentic coding assistant that runs 100% locally — no API keys, no cloud, full privacy. It uses a local LLM (default: qwen3.5:9b) and an agentic loop that decides which tools to call, executes them, and feeds results back to the model until the task is done.

Features

  • Agentic loop — model autonomously decides which tools to call and chains them together
  • 6 built-in tools — read_file, write_file, run_bash, list_dir, search_files, fetch_url
  • Streaming output — responses appear token by token
  • Permission prompts — asks before running bash commands or writing files
  • Loop detection — catches the model repeating the same action
  • Error handling — retries on failures, catches malformed tool calls
  • Configurable — model, host via ~/.ai-cortex/config.yaml or CLI flags

Prerequisites

  • Ollama installed and running
  • A local model pulled (e.g. ollama pull qwen3.5:9b)

Install

pip install ai-cortex

Or install from source:

git clone https://github.com/hasanjawad001/ai-cortex.git
cd ai-cortex
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e .

Usage

# Start ai-cortex
ai-cortex

# Skip permission prompts
ai-cortex --yolo

# Use a different model
ai-cortex --model=llama3:8b

Example

you> read pyproject.toml and tell me the project name
  → read_file({"path": "pyproject.toml"})
  [project]
  name = "ai-cortex"
  ...
ai-cortex> The project name is "ai-cortex", version 0.1.0.

Configuration

AI-Cortex creates ~/.ai-cortex/config.yaml on first run:

model: qwen3.5:9b
host: http://localhost:11434

How It Works

  1. You type a request
  2. The LLM decides which tool(s) to call
  3. AI-Cortex executes the tool and feeds the result back
  4. The LLM either calls another tool or responds with a summary
  5. Repeat until done (max 15 turns)

License

MIT

Metadata

Release files for ai-cortex 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-cortex 0.1.0
File Size Uploaded Provenance
ai_cortex-0.1.0.tar.gz 6.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-cortex 0.1.0
File Interpreter ABI Platform
ai_cortex-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / ai_cortex-0.1.0.tar.gz

Download URL ai_cortex-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4e2ff872925589f18ea2c4dda768afdd27edda9bf1e5f8b166cf3f08b1df28e6
BLAKE2b-256 checksum
How to use checksums
94a4d9cea9f0ca50965720fe0998365579f59936cd722767b70f839b82322873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / ai_cortex-0.1.0-py3-none-any.whl

Download URL ai_cortex-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0268e2f9b894263eed5c0d3885f81a5676bb96d3f819ddc72815d9561eb74820
BLAKE2b-256 checksum
How to use checksums
4f543a6b03488a55f1c8ac68b0c1be8ec938b1a92a00b87dd4969a65a710bc5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for ai-cortex 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page