初始化项目,由ModelHub XC社区提供模型

Model: Raiff1982/codette-llama-3.1-8b-merged
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-15 19:34:09 +08:00
commit a8c3bd174c
9 changed files with 394 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

162
README.md Normal file
View File

@@ -0,0 +1,162 @@
---
license: llama3.1
base_model: meta-llama/Llama-3.1-8B-Instruct
tags:
- codette
- llama-3.1
- merged
- multi-perspective
- reasoning
- orchestrator
language:
- en
pipeline_tag: text-generation
---
# Codette Llama 3.1 8B — Merged Orchestrator Base
Llama 3.1 8B Instruct with the **Codette Orchestrator LoRA** permanently merged into the base weights. This is the inference base for the Codette multi-perspective reasoning system — pair it with the [perspective LoRA adapters](https://huggingface.co/Raiff1982/codette-lora-adapters) for full multi-agent synthesis.
**Paper:** [Codette: Multi-Perspective Reasoning as a Convergent Dynamical System](https://doi.org/10.21203/rs.3.rs-9362560/v1)
**GitHub:** [Raiff1982/Codette-Reasoning](https://github.com/Raiff1982/Codette-Reasoning)
**ORCID:** [0009-0003-7005-8187](https://orcid.org/0009-0003-7005-8187)
---
## Benchmark Results (May 2026)
17-problem benchmark across 6 cognitive categories, 4-condition ablation:
| Condition | Composite Score | vs. Baseline |
|-----------|----------------|--------------|
| SINGLE (baseline) | 0.357 | — |
| MULTI (6 perspectives) | 0.521 | +46.1% |
| MEMORY (+ cocoon store) | 0.574 | +60.8% |
| **CODETTE (full system)** | **0.744** | **+108.8%** |
- Cohen's *d* = 8.31 (large effect; *d* > 0.8 is large by convention)
- Paired *t*-test: *p* < 0.0001
- Turing naturalness: 0.245 0.820 (+235%) depthnaturalness tradeoff resolved
- Coherence: 0.477 0.700
**GPQA (graduate-level science, 0-shot, 198-question diamond set):**
| Run | Accuracy | Environment |
|-----|----------|-------------|
| Base model + adapters (Kaggle cloud, June 17 2026) | **27.8%** (55/198) | Direct transformers+PEFT, no orchestration |
| Full Codette system (local server, June 6 2026) | **30.8%** (61/198) | Multi-agent debate + coherence tracking + cocoon memory |
Baselines: random 25%, GPT-4 0-shot 39%, human expert 65%.
The ~3pp gap between runs quantifies the system layer's contribution on GPQA specifically.
---
## Model Details
| Property | Value |
|---|---|
| Base Model | meta-llama/Llama-3.1-8B-Instruct |
| Merged Adapter | Orchestrator LoRA |
| Format | SafeTensors (full precision, ~16 GB) |
| Context Length | 8192 tokens |
| Quantized version | [codette-llama-3.1-8b-gguf](https://huggingface.co/Raiff1982/codette-llama-3.1-8b-gguf) |
---
## System Architecture
```
Query
Executive Controller (complexity routing)
Merged Orchestrator Base ◄── this repo
LoRA Hot-Swap (newton / davinci / empathy / philosophy /
quantum / consciousness / multi_perspective /
systems_architecture)
Multi-Agent Debate + Semantic Tension (RC+ξ)
AEGIS Ethical Governance (6 frameworks)
Synthesized Response + Cocoon Memory
```
The RC+ξ (Recursive Convergence + Epistemic Tension) formalism models cognitive state evolution as a convergent dynamical system:
```
Ψ(t+1) = Ψ(t) + α·∇Coherence(Ψ(t)) β·ξ(t)·∇Tension(Ψ(t))
```
---
## Quick Start
### With Transformers (full precision)
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Raiff1982/codette-llama-3.1-8b-merged")
tokenizer = AutoTokenizer.from_pretrained("Raiff1982/codette-llama-3.1-8b-merged")
inputs = tokenizer("Explain the nature of consciousness", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### With 4-bit quantization (recommended for 816 GB VRAM)
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16)
model = AutoModelForCausalLM.from_pretrained(
"Raiff1982/codette-llama-3.1-8b-merged",
quantization_config=bnb, device_map="auto"
)
```
### With perspective adapters (multi-agent mode)
```python
from peft import PeftModel
# Apply a perspective adapter on top of the base
model = PeftModel.from_pretrained(model, "Raiff1982/codette-lora-adapters",
subfolder="newton_v2")
```
### Full local server
```bash
git clone https://github.com/Raiff1982/Codette-Reasoning
cd Codette-Reasoning
python inference/codette_server.py # serves on :7860
```
---
## Related Resources
| Resource | Link |
|----------|------|
| Perspective LoRA adapters | [codette-lora-adapters](https://huggingface.co/Raiff1982/codette-lora-adapters) |
| Quantized GGUF | [codette-llama-3.1-8b-gguf](https://huggingface.co/Raiff1982/codette-llama-3.1-8b-gguf) |
| Training datasets | [codette-training-data](https://huggingface.co/datasets/Raiff1982/codette-training-data) |
| GitHub | [Raiff1982/Codette-Reasoning](https://github.com/Raiff1982/Codette-Reasoning) |
| Paper (preprint) | [Research Square DOI](https://doi.org/10.21203/rs.3.rs-9362560/v1) |
| Zenodo archive | [10.5281/zenodo.19480004](https://doi.org/10.5281/zenodo.19480004) |
| Kaggle AGI benchmark | [RC+ Diagnostic Suite](https://kaggle.com/competitions/kaggle-measuring-agi/writeups/codette-rc-diagnostic-suite) |
---
## License
Subject to the [Llama 3.1 Community License](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE).
Created by Jonathan Harrison (Raiff's Bits LLC) independent research.

109
chat_template.jinja Normal file
View File

@@ -0,0 +1,109 @@
{{- bos_token }}
{%- if custom_tools is defined %}
{%- set tools = custom_tools %}
{%- endif %}
{%- if not tools_in_user_message is defined %}
{%- set tools_in_user_message = true %}
{%- endif %}
{%- if not date_string is defined %}
{%- set date_string = "26 Jul 2024" %}
{%- endif %}
{%- if not tools is defined %}
{%- set tools = none %}
{%- endif %}
{#- This block extracts the system message, so we can slot it into the right place. #}
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{%- set system_message = "" %}
{%- endif %}
{#- System message + builtin tools #}
{{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
{%- if builtin_tools is defined or tools is not none %}
{{- "Environment: ipython\n" }}
{%- endif %}
{%- if builtin_tools is defined %}
{{- "Tools: " + builtin_tools | reject('equalto', 'code_interpreter') | join(", ") + "\n\n"}}
{%- endif %}
{{- "Cutting Knowledge Date: December 2023\n" }}
{{- "Today Date: " + date_string + "\n\n" }}
{%- if tools is not none and not tools_in_user_message %}
{{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
{{- "Do not use variables.\n\n" }}
{%- for t in tools %}
{{- t | tojson(indent=4) }}
{{- "\n\n" }}
{%- endfor %}
{%- endif %}
{{- system_message }}
{{- "<|eot_id|>" }}
{#- Custom tools are passed in a user message with some extra guidance #}
{%- if tools_in_user_message and not tools is none %}
{#- Extract the first user message so we can plug it in here #}
{%- if messages | length != 0 %}
{%- set first_user_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
{%- endif %}
{{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
{{- "Given the following functions, please respond with a JSON for a function call " }}
{{- "with its proper arguments that best answers the given prompt.\n\n" }}
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
{{- "Do not use variables.\n\n" }}
{%- for t in tools %}
{{- t | tojson(indent=4) }}
{{- "\n\n" }}
{%- endfor %}
{{- first_user_message + "<|eot_id|>"}}
{%- endif %}
{%- for message in messages %}
{%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
{%- elif 'tool_calls' in message %}
{%- if not message.tool_calls|length == 1 %}
{{- raise_exception("This model only supports single tool-calls at once!") }}
{%- endif %}
{%- set tool_call = message.tool_calls[0].function %}
{%- if builtin_tools is defined and tool_call.name in builtin_tools %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
{{- "<|python_tag|>" + tool_call.name + ".call(" }}
{%- for arg_name, arg_val in tool_call.arguments | items %}
{{- arg_name + '="' + arg_val + '"' }}
{%- if not loop.last %}
{{- ", " }}
{%- endif %}
{%- endfor %}
{{- ")" }}
{%- else %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
{{- '{"name": "' + tool_call.name + '", ' }}
{{- '"parameters": ' }}
{{- tool_call.arguments | tojson }}
{{- "}" }}
{%- endif %}
{%- if builtin_tools is defined %}
{#- This means we're in ipython mode #}
{{- "<|eom_id|>" }}
{%- else %}
{{- "<|eot_id|>" }}
{%- endif %}
{%- elif message.role == "tool" or message.role == "ipython" %}
{{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
{%- if message.content is mapping or message.content is iterable %}
{{- message.content | tojson }}
{%- else %}
{{- message.content }}
{%- endif %}
{{- "<|eot_id|>" }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
{%- endif %}

40
config.json Normal file
View File

@@ -0,0 +1,40 @@
{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 128000,
"dtype": "bfloat16",
"eos_token_id": [
128001,
128008,
128009
],
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 4096,
"initializer_range": 0.02,
"intermediate_size": 14336,
"max_position_embeddings": 131072,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 32,
"num_key_value_heads": 8,
"pad_token_id": null,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_parameters": {
"factor": 8.0,
"high_freq_factor": 4.0,
"low_freq_factor": 1.0,
"original_max_position_embeddings": 8192,
"rope_theta": 500000.0,
"rope_type": "llama3"
},
"tie_word_embeddings": false,
"transformers_version": "5.5.0",
"use_cache": true,
"vocab_size": 128256
}

12
generation_config.json Normal file
View File

@@ -0,0 +1,12 @@
{
"bos_token_id": 128000,
"do_sample": true,
"eos_token_id": [
128001,
128008,
128009
],
"temperature": 0.6,
"top_p": 0.9,
"transformers_version": "5.5.0"
}

15
merge_metadata.json Normal file
View File

@@ -0,0 +1,15 @@
{
"base_model": "meta-llama/Llama-3.1-8B-Instruct",
"adapters_merged": [
"newton",
"davinci",
"empathy",
"philosophy",
"quantum",
"consciousness",
"multi_perspective",
"systems_architecture"
],
"timestamp": "2026-04-06T15:52:49.208848",
"purpose": "HorizonDAW Codette \u2014 merged base for DAW fine-tuning"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2f151735455f64039f4c8202fc9c71a970831aecd786a47bf32ecaeac733fd6b
size 16060556616

BIN
tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

14
tokenizer_config.json Normal file
View File

@@ -0,0 +1,14 @@
{
"backend": "tokenizers",
"bos_token": "<|begin_of_text|>",
"clean_up_tokenization_spaces": true,
"eos_token": "<|eot_id|>",
"is_local": false,
"model_input_names": [
"input_ids",
"attention_mask"
],
"model_max_length": 131072,
"pad_token": "<|eot_id|>",
"tokenizer_class": "TokenizersBackend"
}