# ahmadalameri-0/call_me_maybe architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadalameri-0/call_me_maybe
- Repository: https://github.com/ahmadalameri-0/call_me_maybe

## Overview

Call Me Maybe turns natural-language prompts and function schemas into schema-shaped function-call JSON using greedy constrained decoding with a local Qwen model. Its main path loads and validates prompt/schema files, masks model logits to legal JSON continuations, validates each result, and writes results. The repository also contains Moulinette, a separate CLI for preparing public/private exercises and grading submitted answers. Edges reflect the README and shown entrypoint or module references; unsampled implementation details are not inferred.

Main entry points: [`src/__main__.py`](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/__main__.py) (Generation CLI), [`moulinette/moulinette/__main__.py`](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/__main__.py) (Moulinette CLI), [`src/parser.py`](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/parser.py) (Input loader), [`src/generator.py`](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/generator.py) (Constrained decoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Call generation"]
  node_runner["Generation CLI<br/>[__main__.py]"]
  node_parser["Input loader<br/>[parser.py]"]
end

subgraph group_constraints["Decoding and types"]
  node_models["Data models<br/>[models.py]"]
  node_generator["Constrained decoder<br/>[generator.py]"]
  node_sdk["Local LLM SDK<br/>[__init__.py]"]
end

subgraph group_moulinette["Exercise tooling"]
  node_mcli["Moulinette CLI<br/>[__main__.py]"]
  node_exercise_defs["Exercise functions"]
  node_extractor["Schema exporter"]
  node_testgen["Test and correction generator"]
  node_formatter["Grading output"]
end

subgraph group_outputs["Input and output files"]
  node_prompts["Prompt input"]
  node_definitions["Function schemas"]
  node_results["Call results"]
end

node_user(("Operator"))
node_modelhub["Hugging Face Hub"]

node_user -->|"runs"| node_runner
node_runner -->|"loads inputs"| node_parser
node_parser -->|"reads prompts"| node_prompts
node_parser -->|"reads schemas"| node_definitions
node_parser -->|"validates as"| node_models
node_runner -->|"generates calls"| node_generator
node_runner -->|"loads model"| node_sdk
node_generator -->|"queries logits"| node_sdk
node_generator -->|"uses schemas"| node_models
node_sdk -->|"downloads model files"| node_modelhub
node_runner -->|"writes JSON"| node_results
node_user -->|"runs commands"| node_mcli
node_mcli -->|"selects exercises"| node_exercise_defs
node_mcli -->|"exports schemas"| node_extractor
node_extractor -->|"gets functions"| node_exercise_defs
node_mcli -->|"creates test files"| node_testgen
node_testgen -->|"builds expected outputs"| node_exercise_defs
node_mcli -->|"reports grading"| node_formatter

click node_runner "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/__main__.py"
click node_parser "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/parser.py"
click node_models "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/models.py"
click node_generator "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/generator.py"
click node_sdk "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/llm_sdk/__init__.py"
click node_prompts "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/data/input/function_calling_tests.json"
click node_definitions "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/data/input/functions_definition.json"
click node_results "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/data/output/function_calling_results.json"
click node_mcli "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/__main__.py"
click node_exercise_defs "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/functions_definition.py"
click node_extractor "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/extract_functions_infos.py"
click node_testgen "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/generate_tests_and_corrections.py"
click node_formatter "https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/output_formatter.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_runner,node_parser toneBlue
class node_models,node_generator,node_sdk toneAmber
class node_mcli,node_exercise_defs,node_extractor,node_testgen,node_formatter toneMint
class node_prompts,node_definitions,node_results toneRose
class node_user,node_modelhub toneIndigo
```

## Components

### Call generation

- [Generation CLI](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/__main__.py): `src/__main__.py`
- [Input loader](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/parser.py): `src/parser.py`

### Decoding and types

- [Data models](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/models.py): `src/models.py`
- [Constrained decoder](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/src/generator.py): `src/generator.py`
- [Local LLM SDK](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/llm_sdk/__init__.py): `llm_sdk/__init__.py`

### Exercise tooling

- [Moulinette CLI](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/__main__.py): `moulinette/moulinette/__main__.py`
- [Exercise functions](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/functions_definition.py): `moulinette/moulinette/functions_definition.py`
- [Schema exporter](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/extract_functions_infos.py): `moulinette/moulinette/extract_functions_infos.py`
- [Test and correction generator](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/generate_tests_and_corrections.py): `moulinette/moulinette/generate_tests_and_corrections.py`
- [Grading output](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/moulinette/moulinette/output_formatter.py): `moulinette/moulinette/output_formatter.py`

### Input and output files

- [Prompt input](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/data/input/function_calling_tests.json): `data/input/function_calling_tests.json`
- [Function schemas](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/data/input/functions_definition.json): `data/input/functions_definition.json`
- [Call results](https://github.com/ahmadalameri-0/call_me_maybe/blob/main/data/output/function_calling_results.json): `data/output/function_calling_results.json`

### Other components

- **Operator**
- **Hugging Face Hub**

## Connections

- Operator → Generation CLI: runs (evidence: `README.md`)
- Generation CLI → Input loader: loads inputs (evidence: `src/__main__.py`)
- Input loader → Prompt input: reads prompts (evidence: `src/parser.py`)
- Input loader → Function schemas: reads schemas (evidence: `src/parser.py`)
- Input loader → Data models: validates as (evidence: `src/parser.py`)
- Generation CLI → Constrained decoder: generates calls (evidence: `src/__main__.py`)
- Generation CLI → Local LLM SDK: loads model (evidence: `src/__main__.py`)
- Constrained decoder → Local LLM SDK: queries logits (evidence: `src/generator.py`)
- Constrained decoder → Data models: uses schemas (evidence: `src/generator.py`)
- Local LLM SDK → Hugging Face Hub: downloads model files (evidence: `llm_sdk/__init__.py`)
- Generation CLI → Call results: writes JSON (evidence: `src/__main__.py`)
- Operator → Moulinette CLI: runs commands (evidence: `moulinette/moulinette/__main__.py`)
- Moulinette CLI → Exercise functions: selects exercises (evidence: `moulinette/moulinette/__main__.py`)
- Moulinette CLI → Schema exporter: exports schemas (evidence: `moulinette/moulinette/__main__.py`)
- Schema exporter → Exercise functions: gets functions (evidence: `moulinette/moulinette/extract_functions_infos.py`)
- Moulinette CLI → Test and correction generator: creates test files (evidence: `moulinette/moulinette/__main__.py`)
- Test and correction generator → Exercise functions: builds expected outputs (evidence: `moulinette/moulinette/generate_tests_and_corrections.py`)
- Moulinette CLI → Grading output: reports grading (evidence: `moulinette/moulinette/__main__.py`)
