COReTechnologies's picture
Update README.md
9c73fbe verified
|
Raw History Blame Contribute Delete
6.32 kB
---
license: apache-2.0
library_name: transformers
tags:
- text-generation
- causal-lm
- custom-architecture
- core
pipeline_tag: text-generation
---
<p align="center">
<img src="https://opencore.one/og-image.png" alt="CORe" width="320" />
</p>
# CORe Predetermined V1
**CORe Predetermined V1** is a tiny (30M-parameter) decoder-only language model from **CORe Technologies**, built for one job: **predetermined outcomes without brittle exact-match rules**.
Traditional FAQ / canned-response software matches user input against thousands of stored question strings, and breaks the moment someone types `who's patricia` instead of `who is patricia`. CORe Predetermined takes a different approach: you fine-tune it on your question/answer pairs *once*, and the model generalizes across phrasing, so any reasonable rewording of a covered question returns your predetermined answer.
- **Base model is already filled with a few preview Q&As** (AI-fundamentals concepts) so you can test the behavior immediately, ask about them in any phrasing you like.
- **Fine-tune it on your own Q&A set** to replace or extend the predetermined knowledge. A few dozen pairs is enough.
- Runs anywhere: 120MB, CPU-friendly, no GPU required for inference.
## Quick start
> **Note:** this is a custom architecture, so `trust_remote_code=True` is **required** — without it `from_pretrained` will raise an error about the unknown `core` model type.
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"OpenCOReTechnologies/CORe-Predetermined-v1", trust_remote_code=True
)
model.eval()
tok = AutoTokenizer.from_pretrained("OpenCOReTechnologies/CORe-Predetermined-v1")
def ask(question, max_new_tokens=120, temperature=0.3):
text = tok.apply_chat_template(
[{"role": "user", "content": question}],
add_generation_prompt=True, tokenize=False,
)
enc = tok(text, add_special_tokens=False, return_tensors="pt")
out = model.generate(**enc, max_new_tokens=max_new_tokens,
temperature=temperature, top_k=40, do_sample=True)
return tok.decode(out[0][enc["input_ids"].shape[1]:],
skip_special_tokens=True).strip()
print(ask("what's an intelligent agent?")) # phrasing is flexible
```
## Try the built-in preview questions
The base model ships with a small set of memorized AI-concept answers. Ask them **in your own words**, the point is that exact phrasing doesn't matter:
| Try asking | Observed base-model behavior |
|---|---|
| "What is an intelligent agent?" | **Strongly memorized**, responds with the full structured breakdown ("Let's break down what an intelligent agent is… perception, reasoning, action…") across phrasings |
| "Explain machine learning in simple terms" | **Strongly memorized**, returns the training answer's structure and opening |
| "What is artificial intelligence?" | Memorized concepts (learning, problem-solving, AGI) with some paraphrase drift |
| "What is a neural network?" | Coherent memorized definition, some drift |
| "What is deep learning?" | Coherent short definition, some drift |
The strongly-memorized rows demonstrate the core behavior: one training example, robust retrieval across rephrasings. Fine-tuning on your own pairs moves your content into that strongly-memorized regime.
## Fine-tuning your own predetermined answers
Prepare a text file of Q&A pairs in the chat format:
```
<|user|>
How do I reset my password?
<|assistant|>
Go to Settings → Account → Reset Password. The reset link expires in 15 minutes.
<|endoftext|>
```
Fine-tune with any standard causal-LM loop (the model is a plain `PreTrainedModel`, so `Trainer`, `accelerate`, or a hand-rolled loop all work). At 30M parameters, a full fine-tune runs on a laptop CPU in minutes to hours depending on dataset size. Low learning rates (1e-5 to 5e-5) with a few epochs over your pairs is usually enough; the model is small enough that it will memorize your set quickly while keeping phrasing robustness.
Tips:
- **20–200 pairs per topic cluster** works well; you do *not* need thousands of exact-string variants.
- Keep answers canonical, the model will reproduce the *content* of your answer even when the wording of the question changes.
- Mix in a small amount of generic text if you want to preserve conversational fluency outside your covered topics.
## Available variants
Pick the file that fits your deployment. All produce identical answers; smaller = faster CPU inference.
| File | Size | Use case |
|---|---|---|
| `model.safetensors` | 129 MB | fp32 reference; fine-tuning from this checkpoint |
| `bf16/model.safetensors` | 65 MB | bf16 weights for modern GPUs |
| `gguf/core-predetermined-v1-f16.gguf` | 58 MB | llama.cpp, full precision |
| `gguf/core-predetermined-v1-q8_0.gguf` | 31 MB | llama.cpp, 8-bit, near-lossless |
| `gguf/core-predetermined-v1-q4_k_m.gguf` | **20 MB** | llama.cpp, 4-bit, smaller than most game textures; runs on anything |
**GGUF usage** (llama.cpp, llama-cpp-python, LM Studio, Ollama, etc.):
```bash
llama-completion -m core-predetermined-v1-q4_k_m.gguf \
-p "<|user|>\nwhat even is ai\n<|assistant|>\n" -n 120
```
## Model details
| | |
|---|---|
| Architecture | `COReForCausalLM` (custom CORe decoder-only transformer) |
| Parameters | 29.7M |
| Layers / heads / width | 8 / 8 / 512 |
| Context length | 512 tokens |
| Tokenizer | 8,192-token BPE, chat-formatted (`<\|user\|>`, `<\|assistant\|>`) |
| Training data | ~12.7M tokens of chat-formatted AI-education text |
| License | Apache-2.0 |
## Limitations
- This is a **30M-parameter model**. It is not a general-purpose assistant and will not compete with large models on open-ended tasks; that is not what it's for. Treat it as a flexible lookup layer over your predetermined content.
- Outside its fine-tuned coverage it will improvise, sometimes incorrectly. For production use, gate responses on confidence or restrict usage to covered topics.
- Training data was English-only; other languages are unsupported.
<sub>The architecture is registered as a first-class custom `COReForCausalLM` model (`model_type: core`) via `trust_remote_code`, no external framework code required beyond `transformers` itself.</sub>