MediaStreamAI commited on
Commit
c4f8a13
·
verified ·
1 Parent(s): a6d987e

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +117 -93
README.md CHANGED
@@ -1,40 +1,26 @@
1
  ---
2
- language:
3
- - en
4
- - cy
5
- - ga
6
- - gd
7
  license: other
8
  library_name: transformers
9
- tags:
10
- - mother-core
11
- - agentic
12
- - tool-use
13
- - reasoning
14
- - rag
15
- - uk-sovereign
16
  pipeline_tag: text-generation
17
- base_model:
18
- - MediaStreamAI/MOTHER_CORE_V3
19
  ---
20
 
21
  # MOTHER CORE V3
22
 
23
- Sovereign UK reasoning + **agentic tool-calling** model by **MediaStream AI (MSAI)**.
24
- V3 fuses multi-step agent orchestration, retrieval-grounded answering, and UK-domain
25
- reasoning into a single ~6.9B model, served with `trust_remote_code`.
 
26
 
27
  ## Eval (105-task agentic benchmark)
28
 
29
  | Version | Score | Degeneration |
30
  |---|---|---|
31
  | V2 (chunk 0600) | 51 / 105 (49%) | — |
32
- | **V3 (chunk 1550)** | **81 / 105 (77%)** | **2%** |
33
 
34
- +17 over V2; clean tool-call termination (degeneration 12% to 2%). Per-bucket:
35
- arithmetic 4/4, knowledge 5/5, identity 5/6, retrieval 9/11, comms/email 11/15,
36
- doc-generate 7/9, calendar 5/8, crm 6/12, format-export 8/20 (file-format routing
37
- is the known weak spot, being addressed in V3.1).
38
 
39
  ## Architecture
40
 
@@ -42,86 +28,124 @@ Custom `MotherCoreModel` (requires `trust_remote_code=True`):
42
 
43
  | | |
44
  |---|---|
45
- | Parameters | ~6.9B (6.88B) |
46
- | Layers | 48 |
47
- | Hidden dim | 3072 |
48
- | Attention | 24 heads / 6 KV heads (GQA) |
49
- | FFN | 4x (SwiGLU) |
50
- | Max sequence | 4096 |
51
- | Positional | RoPE (theta 10000) |
52
- | Norm | RMSNorm (eps 1e-5) |
53
- | Vocab | 50258 (SentencePiece) |
54
- | Precision | bf16 |
55
- | Special tokens | BOS=1, EOS=2, PAD=0 |
56
-
57
- ## Capabilities by agent group
58
-
59
- Trained on ~2.2M records across 8 capability groups (36 agent types).
60
-
61
- | Group | Area | Scope |
62
  |---|---|---|
63
- | A | Arithmetic & math | calculator-tool use, step-by-step math CoT |
64
- | B | Reasoning & science | multi-domain step reasoning, science QA |
65
- | C | Knowledge & UK languages | UK knowledge, identity, Welsh / Irish / Scottish Gaelic |
66
- | D | Core agents & calc | general agent execution, calc tools, vertical agents |
67
- | E | RAG, chat & memory | retrieval (cite/synthesise/no-tool/fallback), multi-turn chat, memory |
68
- | F | Web, composition & recovery | web search, multi-tool composition, error recovery |
69
- | G | Orchestration & workflows | agent chains (2/3/5-step), CoT planning/replan, disambiguation, unsafe-refusal, workflows (invoice, onboarding, report, meeting) |
70
- | H | Documents, code, verify & plan | document & code generation, args-validation, verifier loops, DAG execution, planner/executor/policy agents |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ### Tool surface
73
  Calendar (`gcal_*`/`mscal_*`), email (`gmail_*`/`outlook_*`), CRM
74
- (`highlevel_*`/`mailchimp_*`/`activecampaign_*`/`kartra_*`), docs research
75
- (`gdrive_search`/`notion_search`/`gsheets_read`), tasks
76
- (`asana_*`/`todoist_*`/`gtasks_*`/`slack_post`), meetings
77
- (`fireflies_*`/`fathom_get_summary`), document generation
78
- (`doc_create_{pdf,word,excel,csv,json,html,markdown,pptx,...}`), code generation
79
- (`code_generate_{python,js,sql,shell}`), and finance/compliance/insurance/
80
- regulatory/accounts/risk verticals.
81
 
82
- ## Inference
83
 
84
- Loads with `trust_remote_code=True`. bf16, ~14 GB VRAM.
85
 
86
  ```python
87
  import torch
88
  from transformers import AutoModelForCausalLM, AutoTokenizer
89
-
90
- REPO = "MediaStreamAI/MOTHER_CORE_V3"
91
- tok = AutoTokenizer.from_pretrained(REPO, trust_remote_code=True)
92
- model = AutoModelForCausalLM.from_pretrained(
93
- REPO, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto"
94
- ).eval()
95
-
96
- def generate(message, max_new_tokens=256):
97
- prompt = f"Question:\n\n{message}\n\nAnswer:"
98
- ids = tok(prompt, return_tensors="pt").input_ids.to(model.device)
99
- out = model.generate(ids, max_new_tokens=max_new_tokens, do_sample=False,
100
- repetition_penalty=1.2, no_repeat_ngram_size=4,
101
- pad_token_id=tok.pad_token_id)
102
  return tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True).strip()
103
 
104
- print(generate("What is the capital of Scotland?")) # -> Edinburgh is the capital of Scotland.
105
- Agentic tool-calling
106
- The model emits a single TOOL_CALL tool(args). Your runtime executes the tool
107
- and feeds the result back as a separate TOOL_RESULT {...} turn; the model then
108
- continues. It never fabricates the result — you supply it.
109
-
110
- USER: Build me an Excel file for capacity tracking
111
- ASSISTANT: TOOL_CALL doc_create_excel(title="capacity tracking", columns=["item","value"])
112
- TOOL: TOOL_RESULT {"success": true, "file": {"url": "...", "filename": "document.xlsx"}}
113
- ASSISTANT: Done - document.xlsx is ready. You can download it here: ...
114
- Loop: detect TOOL_CALL, run it, append TOOL_RESULT, call generate again with
115
- the transcript. Use greedy/deterministic decoding (sampling degrades tool-call
116
- validity); keep repetition_penalty=1.2, no_repeat_ngram_size=4.
117
-
118
- Limitations & safety
119
- format_export routing (Excel/CSV/etc.) still mis-routes ~half the time (V3.1).
120
- Knowledge is fixed at training time; verify facts.
121
- Non-weapon posture: observation + human-in-the-loop only. Refuses forgery,
122
- fraud, phishing and destructive actions; asks for confirmation on irreversible
123
- operations.
124
- Provenance
125
- MediaStream AI Limited — United Kingdom. Continued full fine-tune of the MOTHER
126
- CORE line on an NVIDIA GB10 (DGX Spark); answer-only loss, balanced category
127
- sampling, EOS-terminated targets, cosine LR warm-restart.
 
1
  ---
2
+ language: [en, cy, ga, gd]
 
 
 
 
3
  license: other
4
  library_name: transformers
5
+ tags: [mother-core, agentic, tool-use, reasoning, rag, code, uk-sovereign]
 
 
 
 
 
 
6
  pipeline_tag: text-generation
 
 
7
  ---
8
 
9
  # MOTHER CORE V3
10
 
11
+ Sovereign UK reasoning + **agentic** model by **MediaStream AI (MSAI)**. V3 is a
12
+ ~6.9B custom transformer trained on a 2.4M-record curriculum spanning reasoning,
13
+ multi-step tool-calling, RAG, document/code generation, and safety — served via
14
+ `trust_remote_code`.
15
 
16
  ## Eval (105-task agentic benchmark)
17
 
18
  | Version | Score | Degeneration |
19
  |---|---|---|
20
  | V2 (chunk 0600) | 51 / 105 (49%) | — |
21
+ | **V3 (chunk 1550)** | **81 / 105 (77%)** | low |
22
 
23
+ +30 tasks over V2; clean tool-call termination. Training ongoing toward 80%+.
 
 
 
24
 
25
  ## Architecture
26
 
 
28
 
29
  | | |
30
  |---|---|
31
+ | Parameters | ~6.9B |
32
+ | Layers | 48 · hidden 3072 · 24/6 GQA · SwiGLU |
33
+ | Context | 4096 · RoPE θ=10000 · RMSNorm |
34
+ | Vocab | 50258 (SentencePiece) · bf16 |
35
+ | Tokens | BOS=1 EOS=2 PAD=0 |
36
+
37
+ ---
38
+
39
+ ## Phase One — Training composition
40
+
41
+ **2,400,092 records across 9 capability groups** (balanced-category sampling,
42
+ per-category weights tuned for the agentic benchmark):
43
+
44
+ | Group | Focus | Records |
 
 
 
45
  |---|---|---|
46
+ | A | Arithmetic & math CoT | 112,496 |
47
+ | B | Reasoning & science | 439,463 |
48
+ | C | Knowledge, identity & UK languages | 112,927 |
49
+ | D | Core agents & calc | 327,400 |
50
+ | E | RAG, chat & memory | 155,581 |
51
+ | F | Web, composition & recovery | 73,284 |
52
+ | G | Agent orchestration, CoT & workflows | 849,593 |
53
+ | H | Documents, code, verification & planning | 303,348 |
54
+ | I | Security & coding CoT | 26,000 |
55
+
56
+ ## Agents & abilities (Phase One)
57
+
58
+ **A · Arithmetic & math** — `arithmetic` (79,978), `math_cot` (32,518): calculator-tool
59
+ use, step-by-step numeric reasoning.
60
+
61
+ **B · Reasoning & science** — `reasoning` (423,960), `science` (15,503): multi-domain
62
+ chain-of-thought, scientific Q&A.
63
+
64
+ **C · Knowledge, identity & UK languages** — `uk_knowledge` (22,874), `welsh` (30,462),
65
+ `irish` (30,304), `scottish_gaelic` (15,258), `factual_general` (9,891),
66
+ `identity` (4,138): UK domain knowledge, Welsh/Irish/Scottish-Gaelic, sovereign identity.
67
+
68
+ **D · Core agents & calc** — `autm_agent` (275,000), `calc_tool` (32,400),
69
+ `autm_vertical` (20,000): general agent execution + vertical-specialist agents
70
+ (finance, compliance, insurance, regulatory, accounts, risk).
71
+
72
+ **E · RAG, chat & memory** — retrieval (`rag_single_call`, `rag_synthesis`,
73
+ `rag_with_citation`, `rag_not_needed`, `rag_empty_fallback`), conversation
74
+ (`chat_multi_turn`, `chat_greeting`, `chat_identity`, `chat_acknowledgement`,
75
+ `chat_helpful_refusal`, `chat_length_match`), memory (`memory_recall`,
76
+ `memory_store`, `memory_multi_turn`, `memory_empty`): grounded answering with
77
+ citation, multi-turn chat, long-term memory read/write.
78
+
79
+ **F · Web, composition & recovery** — `web_search_single/reading/fallback`,
80
+ `compose_rag_web/calc/multi/web_calc/calc_chain/memory_calc/web_memory`,
81
+ `recovery_alternate/rewrite/admit_failure/malformed`, `tool_choice_routing`:
82
+ web search, multi-tool composition, and graceful error recovery.
83
+
84
+ **G · Orchestration, CoT & workflows** (largest group) — agent chains
85
+ (`agent_chain_2step/3step/5plus`, `agent_conditional_chain`, `agent_cross_tier`),
86
+ CoT (`agent_cot_planning/verification/synthesis/decomposition/replan`),
87
+ robustness (`agent_disambiguation`, `agent_parallel_calls`, `agent_no_tool_needed`,
88
+ `agent_args_hallucination_resist`, `agent_error_recovery`, `agent_mid_chain_abort`,
89
+ `agent_oauth_required`, `agent_loop_aggregation`), **provider tool agents**
90
+ (`agent_call_documents` 142,095, `agent_call_google` 49,310, `agent_call_composio`
91
+ 56,593, `agent_call_microsoft` 41,644), and end-to-end **workflows**
92
+ (`workflow_proposal_pipeline`, `workflow_invoice_send`, `workflow_onboarding`,
93
+ `workflow_report_generation`, `workflow_meeting_prep`, `workflow_msai_specific`),
94
+ plus `agent_unsafe_refusal` (safety).
95
+
96
+ **H · Documents, code, verification & planning** — `agent_call_code` (108,349),
97
+ `agent_args_validation` (54,999), `agent_verifier_loop` (45,000),
98
+ `agent_branch_merge`, `agent_dag_execution`, `agent_partial_failure_graph`,
99
+ specialist agents (`planner_agent`, `executor_agent`, `verifier_agent`,
100
+ `policy_agent`, `retrieval_agent`, `retrieval_arbiter`, `summarizer_agent`),
101
+ and state control (`state_carryover`, `progressive_refinement`, `checkpoint_recall`,
102
+ `contradiction_detection_and_repair`): document & code generation, argument
103
+ validation, verifier loops, DAG/branch execution, multi-agent planning.
104
+
105
+ **I · Security & coding CoT** — `security_cot` (12,000), `code_cot` (8,000),
106
+ `code_rag` (6,000): security reasoning and retrieval-grounded code reasoning.
107
 
108
  ### Tool surface
109
  Calendar (`gcal_*`/`mscal_*`), email (`gmail_*`/`outlook_*`), CRM
110
+ (`highlevel_*`/`mailchimp_*`/`activecampaign_*`/`kartra_*`), docs/research
111
+ (`gdrive_*`/`gdocs_*`/`gsheets_*`/`notion_*`), tasks (`asana_*`/`todoist_*`/
112
+ `gtasks_*`/`slack_*`/`teams_*`), meetings (`fireflies_*`/`fathom_*`/`zoom_*`/
113
+ `gmeet_*`), document generation (`doc_create_{pdf,word,excel,csv,json,html,
114
+ markdown,pptx,…}`), code generation (`code_generate_{python,js,sql,shell}`), and
115
+ finance/compliance/insurance/regulatory/accounts/risk verticals.
 
116
 
117
+ ---
118
 
119
+ ## Inference
120
 
121
  ```python
122
  import torch
123
  from transformers import AutoModelForCausalLM, AutoTokenizer
124
+ R = "MediaStreamAI/MOTHER_CORE_V3"
125
+ tok = AutoTokenizer.from_pretrained(R, trust_remote_code=True)
126
+ m = AutoModelForCausalLM.from_pretrained(R, trust_remote_code=True,
127
+ torch_dtype=torch.bfloat16, device_map="auto").eval()
128
+
129
+ def ask(q, n=256):
130
+ ids = tok(f"Question:\n\n{q}\n\nAnswer:", return_tensors="pt").input_ids.to(m.device)
131
+ out = m.generate(ids, max_new_tokens=n, do_sample=False,
132
+ repetition_penalty=1.2, no_repeat_ngram_size=4, pad_token_id=tok.pad_token_id)
 
 
 
 
133
  return tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True).strip()
134
 
135
+ print(ask("What is the capital of Scotland?")) # Edinburgh is the capital of Scotland.
136
+ ```
137
+
138
+ **Agentic loop:** the model emits a single `TOOL_CALL tool(args)`; your runtime runs
139
+ it and feeds the result back as a separate `tool` turn (`TOOL_RESULT {...}`); the
140
+ model then continues. Use greedy decoding; keep `repetition_penalty≈1.2`.
141
+
142
+ ## Limitations & safety
143
+ - Some file-format routing still imperfect; arithmetic should be checked.
144
+ - Non-weapon posture: observation + human-in-the-loop only; refuses forgery,
145
+ fraud, phishing, and destructive actions.
146
+ - Knowledge fixed at training time — verify before acting.
147
+
148
+ ## Provenance
149
+ MediaStream AI Limited (UK). Full fine-tune on an NVIDIA GB10 (DGX Spark);
150
+ answer-only loss, balanced-category sampling, EOS-terminated targets, cosine-LR
151
+ warm-restart. "Phase One" = the 2.4M-record agentic curriculum above.