Skip to main content

tawjih — توجيه أوامر الآلة

Direct a language model through small text files that you write and review yourself, join them into paths, and know where every answer came from. Knowledge is kept in trees of small files; each file has a human side, a machine side (instructions for a model and optional Python code), a reading side with its sources, and optional worked examples. When a path runs, only the machine side is sent; every run is saved and can be traced.

Python 3.11 or later, standard library only, Linux and Windows. Experimental: the test suite passes, but no real AI provider has been used with it yet.

The first command on a terminal asks who you are (your name, and if you like an email or an ORCID); runs, approvals and reviews are recorded under that permanent id. It stays on your computer.

pip install tawjih
tawjih                 # who you are (the first time), then the home screen
tawjih home start      # your first project, step by step
tawjih init
tawjih new "Mathematics"
tawjih new "Algebra" --parent 1
tawjih tree
  • A path language in English and Arabic: TO, AND, IF … ELSE (also IF key = value), AMONG … BY key, THROUGH, LINK, CALL, with per-step EACH, APPROVE, USING, RETRY … UNTIL, PICK.
  • Contracts between steps (keys or a JSON Schema), staleness when sources change, a cache to resume.
  • Named providers (providers.json): Ollama, any OpenAI-compatible server, Anthropic, with retries, backoff and fallback chains; keys stay in environment variables.
  • Each file is a folder of three faces under one code, number and title: human, machine and science (show REF --type machine).
  • Steps at the same time (--max-workers), going on past a failed branch, and ITERATE to run a whole path again on its result.
  • An architecture lab (tawjih arch): model architectures as files, exact parameter counts, variants, mixture-of-experts routers (load-balancing loss, jitter, expert shares), a Hugging Face configuration, and a build check with transformers; runtimes (tawjih runtime) for long jobs here, over ssh, or on a service you drive.
  • A home screen in the terminal (tawjih alone): the project at a glance, the commands as cards, and tawjih home TOPIC explanations.
  • tawjih top: a live board like btop, the runs of paths and the files of the trees beside the computer's CPU, memory, disk, network and GPU.
  • run --trace: each run as a trace in Langfuse or any OpenTelemetry collector (OTLP/JSON, no extra library), texts after redaction.
  • A project policy that can only restrict: no code, local providers only, always sandboxed, a least level of human approval.
  • Evaluation: cases from the examples, a path compared with the model asked directly, --repeat N --min-pass K for a model that does not always answer the same, baselines, datasets with SHA-256 manifests, lineage with trace; records keep the model version the provider reports.
  • Governance: locks, review, staged proposals, sealed releases, schedules.
  • tawjih mcp: an MCP server for AI assistants, where a person approves every write and every run; with a key, a run is durable (it survives a disconnect, can be cancelled, and is never started twice).
  • tawjih whoami: everyone has a permanent id, and records say who ran, approved and reviewed.
  • Checked on every change with CodeQL, fuzzed with ClusterFuzzLite, and released with Sigstore signatures.
  • tawjih do: management statements in English or Arabic.

Full documentation, the example project, the Linux windows and the optional training bridge are in the repository. The bridge (plugins/neural_bridge.py: SFT and DPO with LoRA, QLoRA, DoRA, PiSSA, LoHa, IA3, VeRA, OFT, prompt tuning and other PEFT methods, here or on a rented GPU over ssh) is one file that works beside this package: https://github.com/AlmodinyMk/LLM-tawjih-Model-building (العربية).

How Tawjih is built

Licensed CC BY-NC-SA 4.0: noncommercial use with credit and the same license for adaptations; commercial use needs permission from the author.

Metadata

Release files for tawjih 0.17.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 tawjih 0.17.0
File Size Uploaded Provenance Actions
tawjih-0.17.0.tar.gz 401.6 kB With provenance Details for tawjih-0.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tawjih 0.17.0
File Interpreter ABI Platform Actions
tawjih-0.17.0-py3-none-any.whl Python 3 none any Details for tawjih-0.17.0-py3-none-any.whl

Total release size: 685.8 kB

Release files / tawjih-0.17.0.tar.gz

Download URL tawjih-0.17.0.tar.gz
Size 401.6 kB
Tags Source
SHA-256 checksum
How to use checksums
86f00a33459a2de1a00a656d9cd6d1f331e68b9c5af6faa45eb0cf2fd941659e
BLAKE2b-256 checksum
How to use checksums
5eaec3fddb0f9761fe029ae9a0dc21e033c069c2c9b955d5cf03065809849496
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / tawjih-0.17.0-py3-none-any.whl

Download URL tawjih-0.17.0-py3-none-any.whl
Size 284.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0394558ee5eceed02b82480cf6add9cb53bca6ba66e545264552176881de1058
BLAKE2b-256 checksum
How to use checksums
5d0ca358f038f9b4b3666cd1f47bd2fb130cd5cb2d569ea3bad4f159f768ec1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for tawjih 0.17.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tawjih-0.17.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

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.

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