# topnomen/gitingest architecture

> Architecture diagram of the GitHub repository topnomen/gitingest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/topnomen/gitingest
- Repository: https://github.com/topnomen/gitingest

## Overview

CALL ME MAYBE is a command-line function-calling tool: it reads function definitions and questions, asks a local language model to select a function and generate a JSON call, then parses and validates that call before saving results. The runtime is orchestrated by `src/main.py`; supporting layers define the call schema, construct prompts, constrain token generation, load the model vocabulary, and validate outputs. The SDK loads a Hugging Face causal language model and tokenizer. No README was provided, so capabilities and relationships here are based on the sampled source; the output directory is created at runtime and is not present in the tree.

Main entry points: [`src/main.py`](https://github.com/topnomen/gitingest/blob/main/src/main.py) (Pipeline CLI), [`llm_sdk/llm_sdk/__init__.py`](https://github.com/topnomen/gitingest/blob/main/llm_sdk/llm_sdk/__init__.py) (Local model SDK), [`src/model.py`](https://github.com/topnomen/gitingest/blob/main/src/model.py) (Call schemas), [`src/prompt_builder.py`](https://github.com/topnomen/gitingest/blob/main/src/prompt_builder.py) (Prompt builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and schemas"]
  node_function_defs["Function definitions"]
  node_question_set["Question set"]
  node_call_schema["Call schemas<br/>[model.py]"]
end

subgraph group_generation["Model and generation"]
  node_entry["Pipeline CLI<br/>[main.py]"]
  node_prompt_builder["Prompt builder<br/>[prompt_builder.py]"]
  node_vocab_loader["Vocabulary loader<br/>[vocabulary.py]"]
  node_constrained_decode["JSON token constraints"]
end

subgraph group_validation["Call validation"]
  node_json_decoder["JSON extractor<br/>[decoder.py]"]
  node_call_validator["Function-call validator<br/>[validator.py]"]
end

subgraph group_sdk["Inference SDK"]
  node_local_model["Local model SDK<br/>[__init__.py]"]
end

node_user(("CLI user"))
node_model_provider["Hugging Face model"]
node_result_file["Results JSON"]

node_user -->|"runs"| node_entry
node_entry -->|"loads"| node_function_defs
node_entry -->|"loads"| node_question_set
node_entry -->|"constructs"| node_call_schema
node_entry -->|"builds prompt"| node_prompt_builder
node_prompt_builder -->|"reads definitions"| node_call_schema
node_entry -->|"loads and queries"| node_local_model
node_entry -->|"loads vocabulary"| node_vocab_loader
node_vocab_loader -->|"gets vocab path"| node_local_model
node_entry -->|"constrains logits"| node_constrained_decode
node_entry -->|"extracts JSON"| node_json_decoder
node_entry -->|"validates call"| node_call_validator
node_call_validator -->|"returns call model"| node_call_schema
node_local_model -->|"loads model"| node_model_provider
node_entry -->|"writes results"| node_result_file

click node_entry "https://github.com/topnomen/gitingest/blob/main/src/main.py"
click node_function_defs "https://github.com/topnomen/gitingest/blob/main/data/input/functions_definition.json"
click node_question_set "https://github.com/topnomen/gitingest/blob/main/data/input/function_calling_tests.json"
click node_call_schema "https://github.com/topnomen/gitingest/blob/main/src/model.py"
click node_prompt_builder "https://github.com/topnomen/gitingest/blob/main/src/prompt_builder.py"
click node_vocab_loader "https://github.com/topnomen/gitingest/blob/main/src/vocabulary.py"
click node_constrained_decode "https://github.com/topnomen/gitingest/blob/main/src/constrained_decoder.py"
click node_local_model "https://github.com/topnomen/gitingest/blob/main/llm_sdk/llm_sdk/__init__.py"
click node_json_decoder "https://github.com/topnomen/gitingest/blob/main/src/decoder.py"
click node_call_validator "https://github.com/topnomen/gitingest/blob/main/src/validator.py"

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_function_defs,node_question_set,node_call_schema,node_user toneBlue
class node_entry,node_prompt_builder,node_vocab_loader,node_constrained_decode toneAmber
class node_json_decoder,node_call_validator toneMint
class node_local_model toneRose
class node_model_provider,node_result_file toneIndigo
```

## Components

### Inputs and schemas

- [Function definitions](https://github.com/topnomen/gitingest/blob/main/data/input/functions_definition.json): `data/input/functions_definition.json`
- [Question set](https://github.com/topnomen/gitingest/blob/main/data/input/function_calling_tests.json): `data/input/function_calling_tests.json`
- [Call schemas](https://github.com/topnomen/gitingest/blob/main/src/model.py): `src/model.py`

### Model and generation

- [Pipeline CLI](https://github.com/topnomen/gitingest/blob/main/src/main.py): `src/main.py`
- [Prompt builder](https://github.com/topnomen/gitingest/blob/main/src/prompt_builder.py): `src/prompt_builder.py`
- [Vocabulary loader](https://github.com/topnomen/gitingest/blob/main/src/vocabulary.py): `src/vocabulary.py`
- [JSON token constraints](https://github.com/topnomen/gitingest/blob/main/src/constrained_decoder.py): `src/constrained_decoder.py`

### Call validation

- [JSON extractor](https://github.com/topnomen/gitingest/blob/main/src/decoder.py): `src/decoder.py`
- [Function-call validator](https://github.com/topnomen/gitingest/blob/main/src/validator.py): `src/validator.py`

### Inference SDK

- [Local model SDK](https://github.com/topnomen/gitingest/blob/main/llm_sdk/llm_sdk/__init__.py): `llm_sdk/llm_sdk/__init__.py`

### Other components

- **CLI user**
- **Hugging Face model**
- **Results JSON**

## Connections

- CLI user → Pipeline CLI: runs
- Pipeline CLI → Function definitions: loads (evidence: `src/main.py`)
- Pipeline CLI → Question set: loads (evidence: `src/main.py`)
- Pipeline CLI → Call schemas: constructs (evidence: `src/main.py`)
- Pipeline CLI → Prompt builder: builds prompt (evidence: `src/main.py`)
- Prompt builder → Call schemas: reads definitions (evidence: `src/prompt_builder.py`)
- Pipeline CLI → Local model SDK: loads and queries (evidence: `src/main.py`)
- Pipeline CLI → Vocabulary loader: loads vocabulary (evidence: `src/main.py`)
- Vocabulary loader → Local model SDK: gets vocab path (evidence: `src/vocabulary.py`)
- Pipeline CLI → JSON token constraints: constrains logits (evidence: `src/main.py`)
- Pipeline CLI → JSON extractor: extracts JSON (evidence: `src/main.py`)
- Pipeline CLI → Function-call validator: validates call (evidence: `src/main.py`)
- Function-call validator → Call schemas: returns call model (evidence: `src/validator.py`)
- Local model SDK → Hugging Face model: loads model (evidence: `llm_sdk/llm_sdk/__init__.py`)
- Pipeline CLI → Results JSON: writes results (evidence: `src/main.py`)
