# cheahjs/free-llm-api-resources architecture

> Architecture diagram of the GitHub repository cheahjs/free-llm-api-resources, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cheahjs/free-llm-api-resources
- Repository: https://github.com/cheahjs/free-llm-api-resources

## Overview

1. This repository is a content-maintenance project, not an application runtime. Its main artifact is the top-level `README.md`, which is treated as generated documentation rather than hand-edited source.

2. The primary source of truth appears to live under `src/`. In particular, `src/data.py` likely contains the structured provider/model data that feeds the README, while `src/README_template.md` provides the markdown scaffold used to format the final document.

3. `src/pull_available_models.py` is the generator. The README itself explicitly says it is generated by this script, so the main data flow is: structured Python data in `data.py` and/or external model metadata → generator script → rendered `README.md`.

4. The generated README is a curated catalog of LLM API providers, grouped into “Free Providers” and “Providers with trial credits.” That grouping is the key logical boundary in the output: provider sections, limits, credits, and model lists are assembled into a single published index.

5. The repository also contains a small asset, `src/1-second-of-silence.mp3`, which is likely auxiliary to the generator or its presentation layer. It is not part of the core architecture, but it does indicate the repo may include non-text assets for tooling or output decoration.

6. There is no application backend, client, database, or service layer here. The main “system” is a documentation-generation pipeline centered on Python, with the generated markdown serving as the deliverable.

7. GitHub Actions provide automation around that pipeline. `update-readme.yml` is presumably responsible for regenerating and committing or proposing README updates when the underlying source changes, while `readme-change-validator.yml` enforces that README edits remain consistent with the generator.

8. The `.github/pull_request_template.md` and README warning together define the contributor boundary: users should change source files, not `README.md` directly. This is an important architectural rule because it prevents drift between generated output and source data.

9. `src/requirements.txt` defines the Python dependencies needed to run the generator. That makes the generation step reproducible in CI and on developer machines.

10. The external-service boundary is informational rather than runtime-integrated: the README points to many third-party AI providers and their rate limits, credits, and model availability, but the repository itself is acting as an index/aggregator, not as a proxy or API client.

Main entry points: [`src/pull_available_models.py`](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/pull_available_models.py) (Generator), [`README.md`](https://github.com/cheahjs/free-llm-api-resources/blob/main/README.md) (README), [`.github/workflows/readme-change-validator.yml`](https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/workflows/readme-change-validator.yml) (Validator), [`src/data.py`](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/data.py) (Provider data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source of truth"]
  node_data_py["Provider data<br/>structured data<br/>[data.py]"]
  node_template_md["README template<br/>markdown scaffold<br/>[README_template.md]"]
  node_generator_py["Generator<br/>python script"]
  node_requirements_txt["Deps<br/>[requirements.txt]"]
  node_silence_mp3["Audio asset<br/>aux asset"]
end

subgraph group_automation["Automation"]
  node_pr_template["PR template<br/>contributor guide"]
  node_validate_wf["Validator<br/>workflow"]
  node_update_wf["Updater<br/>workflow<br/>[update-readme.yml]"]
end

subgraph group_published["Published catalog"]
  node_readme["README<br/>generated doc<br/>[README.md]"]
  node_free_providers["Free providers<br/>catalog section"]
  node_trial_providers["Trial credits<br/>catalog section"]
  node_provider_rows["Provider lists<br/>tabular content"]
end

node_contributor(("Contributor<br/>actor"))

node_contributor -->|"guided by"| node_pr_template
node_contributor -->|"edits"| node_data_py
node_contributor -->|"edits"| node_template_md
node_generator_py -->|"reads"| node_data_py
node_generator_py -->|"fills"| node_template_md
node_generator_py -->|"runs with"| node_requirements_txt
node_generator_py -.->|"bundles"| node_silence_mp3
node_generator_py -->|"renders"| node_readme
node_readme -->|"contains"| node_free_providers
node_readme -->|"contains"| node_trial_providers
node_free_providers -->|"organizes"| node_provider_rows
node_trial_providers -->|"organizes"| node_provider_rows
node_update_wf -->|"invokes"| node_generator_py
node_update_wf -->|"updates"| node_readme
node_validate_wf -->|"checks"| node_readme
node_validate_wf -->|"compares"| node_data_py
node_validate_wf -->|"reuses"| node_generator_py

click node_data_py "https://github.com/cheahjs/free-llm-api-resources/blob/main/src/data.py"
click node_template_md "https://github.com/cheahjs/free-llm-api-resources/blob/main/src/README_template.md"
click node_generator_py "https://github.com/cheahjs/free-llm-api-resources/blob/main/src/pull_available_models.py"
click node_requirements_txt "https://github.com/cheahjs/free-llm-api-resources/blob/main/src/requirements.txt"
click node_silence_mp3 "https://github.com/cheahjs/free-llm-api-resources/blob/main/src/1-second-of-silence.mp3"
click node_pr_template "https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/pull_request_template.md"
click node_validate_wf "https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/workflows/readme-change-validator.yml"
click node_update_wf "https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/workflows/update-readme.yml"
click node_readme "https://github.com/cheahjs/free-llm-api-resources/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_data_py,node_template_md,node_generator_py,node_requirements_txt,node_silence_mp3 toneBlue
class node_pr_template,node_validate_wf,node_update_wf toneAmber
class node_readme,node_free_providers,node_trial_providers,node_provider_rows toneMint
class node_contributor toneNeutral
```

## Components

### Source of truth

Editable inputs and generation code

- [Provider data](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/data.py): structured data · Canonical provider/model metadata used by the generator · `src/data.py`
- [README template](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/README_template.md): markdown scaffold · Formatting scaffold for the generated README · `src/README_template.md`
- [Generator](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/pull_available_models.py): python script · Builds the rendered model/provider catalog · `src/pull_available_models.py`
- [Deps](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/requirements.txt): python deps · Runtime dependencies for the generation step · `src/requirements.txt`
- [Audio asset](https://github.com/cheahjs/free-llm-api-resources/blob/main/src/1-second-of-silence.mp3): aux asset · Non-text asset available to the repo · `src/1-second-of-silence.mp3`

### Automation

GitHub Actions and contributor guardrails

- [PR template](https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/pull_request_template.md): contributor guide · Directs contributors toward source changes rather than README edits · `.github/pull_request_template.md`
- [Validator](https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/workflows/readme-change-validator.yml): workflow · Checks that README changes stay consistent with generated source · `.github/workflows/readme-change-validator.yml`
- [Updater](https://github.com/cheahjs/free-llm-api-resources/blob/main/.github/workflows/update-readme.yml): workflow · Regenerates and refreshes the README in CI · `.github/workflows/update-readme.yml`

### Published catalog

Generated README and its catalog structure

- [README](https://github.com/cheahjs/free-llm-api-resources/blob/main/README.md): generated doc · Published catalog of LLM API providers · `README.md`
- **Free providers**: catalog section · README section for no-cost providers
- **Trial credits**: catalog section · README section for providers with trial credits
- **Provider lists**: tabular content · Per-provider entries with limits, credits, and model availability

### Other components

- **Contributor**: actor · Edits source files instead of the generated README

## Connections

- Contributor → PR template: guided by · Contributor workflow steered by PR instructions
- Contributor → Provider data: edits · Source data is the intended edit surface
- Contributor → README template: edits · Template changes affect rendered output
- Generator → Provider data: reads · Consumes structured provider metadata
- Generator → README template: fills · Uses the markdown scaffold
- Generator → Deps: runs with · Depends on declared Python packages
- Generator → Audio asset: bundles · Auxiliary asset available to the generation repo
- Generator → README: renders · Produces the published README
- README → Free providers: contains · Generated catalog includes free providers
- README → Trial credits: contains · Generated catalog includes trial-credit providers
- Free providers → Provider lists: organizes · Section groups provider entries
- Trial credits → Provider lists: organizes · Section groups provider entries
- Updater → Generator: invokes · CI refreshes the generated document
- Updater → README: updates · Workflow commits or proposes README regeneration
- Validator → README: checks · Validates README against source of truth
- Validator → Provider data: compares · Ensures README matches underlying source data
- Validator → Generator: reuses · Validator relies on the same generation logic
