# jydx-tech/call_me_maybe architecture

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

- Interactive diagram: https://gitdiagram.com/jydx-tech/call_me_maybe
- Repository: https://github.com/jydx-tech/call_me_maybe

## Overview

Call Me Maybe turns natural-language requests into structured function-call records; it selects a function and generates typed arguments but never executes the selected function. The CLI loads and validates the function catalog and prompts, initializes the model and vocabulary, processes each prompt, then writes the calls as JSON. Prompt construction and constrained token decoding are the principal internal layers: the model chooses content while the code enforces function-name and value-type constraints. The README documents this workflow and capability; source excerpts show the main calls, but not every runtime detail.

Main entry points: [`src/__main__.py`](https://github.com/jydx-tech/call_me_maybe/blob/main/src/__main__.py) (CLI orchestrator), [`src/engine.py`](https://github.com/jydx-tech/call_me_maybe/blob/main/src/engine.py) (Prompt processor), [`llm_sdk/__init__.py`](https://github.com/jydx-tech/call_me_maybe/blob/main/llm_sdk/__init__.py) (LLM inference SDK), [`src/loader.py`](https://github.com/jydx-tech/call_me_maybe/blob/main/src/loader.py) (Input loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Request workflow"]
  node_cli["CLI orchestrator<br/>[__main__.py]"]
  node_function_catalog["Function catalog"]
  node_prompt_batch["Prompt batch"]
  node_engine["Prompt processor<br/>[engine.py]"]
  node_writer["Call writer<br/>[writer.py]"]
  node_call_output["Function call JSON"]
end

subgraph group_generation["Prompt and decoding"]
  node_prompt_builder["Prompt builder<br/>[prompts.py]"]
  node_decoder["Constrained decoder<br/>[decoder.py]"]
  node_vocabulary["Token vocabulary<br/>[tokens.py]"]
end

subgraph group_model["Model inference"]
  node_model_sdk["LLM inference SDK<br/>[__init__.py]"]
  node_hf_hub["Hugging Face Hub"]
end

subgraph group_data["Validated data"]
  node_loader["Input loader<br/>[loader.py]"]
  node_schemas["Data schemas<br/>[models.py]"]
end

node_requester(("Request provider"))

node_requester -->|"submits requests"| node_cli
node_cli -->|"loads inputs"| node_loader
node_function_catalog -->|"catalog input"| node_loader
node_prompt_batch -->|"prompt input"| node_loader
node_loader -->|"validates as"| node_schemas
node_cli -->|"processes prompts"| node_engine
node_engine -->|"builds prompts"| node_prompt_builder
node_engine -->|"generates values"| node_decoder
node_engine -->|"encodes text"| node_model_sdk
node_engine -->|"creates call"| node_schemas
node_decoder -->|"requests logits"| node_model_sdk
node_decoder -->|"filters tokens"| node_vocabulary
node_cli -->|"initializes model"| node_model_sdk
node_cli -->|"loads vocabulary"| node_vocabulary
node_model_sdk -->|"downloads model files"| node_hf_hub
node_cli -->|"writes calls"| node_writer
node_writer -->|"serializes JSON"| node_call_output

click node_cli "https://github.com/jydx-tech/call_me_maybe/blob/main/src/__main__.py"
click node_function_catalog "https://github.com/jydx-tech/call_me_maybe/blob/main/data/input/functions_definition.json"
click node_prompt_batch "https://github.com/jydx-tech/call_me_maybe/blob/main/data/input/function_calling_tests.json"
click node_loader "https://github.com/jydx-tech/call_me_maybe/blob/main/src/loader.py"
click node_schemas "https://github.com/jydx-tech/call_me_maybe/blob/main/src/models.py"
click node_engine "https://github.com/jydx-tech/call_me_maybe/blob/main/src/engine.py"
click node_prompt_builder "https://github.com/jydx-tech/call_me_maybe/blob/main/src/prompts.py"
click node_decoder "https://github.com/jydx-tech/call_me_maybe/blob/main/src/decoder.py"
click node_vocabulary "https://github.com/jydx-tech/call_me_maybe/blob/main/src/tokens.py"
click node_model_sdk "https://github.com/jydx-tech/call_me_maybe/blob/main/llm_sdk/__init__.py"
click node_writer "https://github.com/jydx-tech/call_me_maybe/blob/main/src/writer.py"
click node_call_output "https://github.com/jydx-tech/call_me_maybe/blob/main/data/output/function_calls.json"

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_cli,node_function_catalog,node_prompt_batch,node_engine,node_writer,node_call_output toneBlue
class node_prompt_builder,node_decoder,node_vocabulary toneAmber
class node_model_sdk,node_hf_hub,node_requester toneMint
class node_loader,node_schemas toneRose
```

## Components

### Request workflow

- [CLI orchestrator](https://github.com/jydx-tech/call_me_maybe/blob/main/src/__main__.py): `src/__main__.py`
- [Function catalog](https://github.com/jydx-tech/call_me_maybe/blob/main/data/input/functions_definition.json): `data/input/functions_definition.json`
- [Prompt batch](https://github.com/jydx-tech/call_me_maybe/blob/main/data/input/function_calling_tests.json): `data/input/function_calling_tests.json`
- [Prompt processor](https://github.com/jydx-tech/call_me_maybe/blob/main/src/engine.py): `src/engine.py`
- [Call writer](https://github.com/jydx-tech/call_me_maybe/blob/main/src/writer.py): `src/writer.py`
- [Function call JSON](https://github.com/jydx-tech/call_me_maybe/blob/main/data/output/function_calls.json): `data/output/function_calls.json`

### Prompt and decoding

- [Prompt builder](https://github.com/jydx-tech/call_me_maybe/blob/main/src/prompts.py): `src/prompts.py`
- [Constrained decoder](https://github.com/jydx-tech/call_me_maybe/blob/main/src/decoder.py): `src/decoder.py`
- [Token vocabulary](https://github.com/jydx-tech/call_me_maybe/blob/main/src/tokens.py): `src/tokens.py`

### Model inference

- [LLM inference SDK](https://github.com/jydx-tech/call_me_maybe/blob/main/llm_sdk/__init__.py): `llm_sdk/__init__.py`
- **Hugging Face Hub**

### Validated data

- [Input loader](https://github.com/jydx-tech/call_me_maybe/blob/main/src/loader.py): `src/loader.py`
- [Data schemas](https://github.com/jydx-tech/call_me_maybe/blob/main/src/models.py): `src/models.py`

### Other components

- **Request provider**

## Connections

- Request provider → CLI orchestrator: submits requests (evidence: `README.md`)
- CLI orchestrator → Input loader: loads inputs (evidence: `src/__main__.py`)
- Function catalog → Input loader: catalog input (evidence: `README.md`)
- Prompt batch → Input loader: prompt input (evidence: `README.md`)
- Input loader → Data schemas: validates as (evidence: `src/loader.py`)
- CLI orchestrator → Prompt processor: processes prompts (evidence: `src/__main__.py`)
- Prompt processor → Prompt builder: builds prompts (evidence: `src/engine.py`)
- Prompt processor → Constrained decoder: generates values (evidence: `src/engine.py`)
- Prompt processor → LLM inference SDK: encodes text (evidence: `src/engine.py`)
- Prompt processor → Data schemas: creates call (evidence: `src/engine.py`)
- Constrained decoder → LLM inference SDK: requests logits (evidence: `src/decoder.py`)
- Constrained decoder → Token vocabulary: filters tokens (evidence: `src/decoder.py`)
- CLI orchestrator → LLM inference SDK: initializes model (evidence: `src/__main__.py`)
- CLI orchestrator → Token vocabulary: loads vocabulary (evidence: `src/__main__.py`)
- LLM inference SDK → Hugging Face Hub: downloads model files (evidence: `llm_sdk/__init__.py`)
- CLI orchestrator → Call writer: writes calls (evidence: `src/__main__.py`)
- Call writer → Function call JSON: serializes JSON (evidence: `src/writer.py`)
