Instructions to use Truthseeker87/llama-tinker-lora-news-enhancer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Truthseeker87/llama-tinker-lora-news-enhancer with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Llama-3.2-1B") model = PeftModel.from_pretrained(base_model, "Truthseeker87/llama-tinker-lora-news-enhancer") - Notebooks
- Google Colab
- Kaggle
- π€ LLM-Powered News Content Enhancer
- π― Project Overview
- ποΈ System Architecture
- π¬ Why LoRA
- ποΈ Why Ollama
- π Results (Pilot, Needs Rerun)
- π₯οΈ Local Use (October 2025)
- π Documentation
- π Quick Start
- π Project Structure (GitHub Repository)
- π οΈ Technologies Used
- Limitations
- Corrections
- π€ Contributing
- π License
- π Acknowledgments
- π§ Contact
π€ LLM-Powered News Content Enhancer
Fine-tuning LLaMA 3.2-1B with LoRA for Semantic News Content Analysis
Version 2 supersedes this pilot. This repository holds the October 2025 pilot (v1) adapter. Version 2 uses 460 annotated news items, a 96 item held out test set and a three model comparison. See Truthseeker87/llama-tinker-lora-news-enhancer-v2 on Hugging Face and the v2 GitHub repository with its Corrections section.
The v1 quality metrics need a rerun. The v1 evaluation scored 5 examples. The reference outputs were template strings. A November 2026 review of the notebook code found that the evaluation took its references from different articles than the predictions. The v1 quality score (0.8674), ROUGE, BERTScore and the "+162%" figure therefore do not measure article analysis quality. See Limitations and Corrections.
What this Hugging Face repository holds: the v1 Tinker LoRA adapter (adapter_model.safetensors and adapter_config.json) and the three chart images in images/. The notebook, data files and result files are in the GitHub repository.
π― Project Overview
Personal Project Context
This is a personal project addressing my need around news analysis of the fast-moving AI industry. I collect AI-related news content from various sources and needed a way to enhance raw news content with rich semantic metadata.
Intended Outcome
I wanted structured metadata on each news item. My goal was to help Google NotebookLM and its Gemini models find patterns across trends and developments in the AI industry. I did not measure whether the metadata improved NotebookLM output.
What This Project Does
- Enhance and add rich semantic metadata to AI-related news content as part of my news analyst application system
- Explore and compare the managed Tinker training and fine tuning API from Thinking Machines
- Explore LastMile AI's MCP (Model Context Protocol) framework for building AI-powered applications
Why This Matters to Me
I wanted structured fields (relevance, companies, topics) on each news item. Those fields would let NotebookLM compare items across weeks. I did not measure the effect on NotebookLM output.
ποΈ System Architecture
This fine tuning project feeds a private personal project, the News Analyst MCP Agent.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β News Analyst MCP Agent β
β (Private personal project, not public) β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β LLM Enhancement Layer β β This Project
β (Tinker LoRA adapter β
β served by Ollama) β
βββββββββββββββββββββββββ
The agent configuration names the Ollama model llama3.2:newsletter-lora, which I built from the Tinker adapter. I also trained an Unsloth adapter in the notebook. The Unsloth v1 adapter failed the JSON check, and the agent does not use it.
Integration Context:
- Deployment: Local Windows Surface Pro (Intel Iris Xe, 16GB RAM)
- Base Model: LLaMA 3.2-1B (1 billion parameters)
- Architecture: LoRA adapters for parameter-efficient fine-tuning
- System overview: See
docs/NEWS_ANALYST_SYSTEM_ARCHITECTURE.mdin the GitHub repository. That document still repeats unmeasured benefit figures that this card removed.
π¬ Why LoRA
I chose LoRA because it fit the free Colab GPU and produced a small adapter. I did not run full fine tuning, so I have no measured comparison between LoRA and full fine tuning.
What the files record:
- The Tinker adapter uses LoRA rank 32, alpha 32, on all linear layers (
adapter_config.jsonin the GitHub repository). - The Unsloth run reported 11,272,192 trainable parameters of 1,247,086,592 (0.90%) in notebook cell 70.
- The Tinker run did not record a trainable parameter count.
docs/LORA_COMPARISON.md explains my reasoning. Its weighted scores are my own ratings, not measurements.
ποΈ Why Ollama
I used Ollama because it installed easily on my Windows laptop and exposes an HTTP API. I did not benchmark it against llama.cpp.
π Results (Pilot, Needs Rerun)
What the evaluation did
- The notebook ran the evaluation on 5 examples (notebook cell 79,
num_samples=5). - The notebook generated the 5 predictions from rows of the 101 row annotated training file. The evaluation configuration sets the test data path to the training file (
notebooks/news_analyst_1.py, line 2959). - The metric code then took the reference outputs from the separate 246 row test file (
notebooks/news_analyst_1.py, lines 4134 to 4144). The references therefore came from different articles than the predictions. - The assistant targets in the data files are fixed template responses, not article specific analyses.
For these reasons the quality score, ROUGE, BERTScore and Sentence-BERT values in results/metrics/ (GitHub repository) do not measure article analysis quality. I removed them from this card. They need a rerun with matched predictions and references on held out articles.
What the 5 outputs show
On the 5 rows, only the Tinker adapter returned valid JSON. The base model returned markdown. The Unsloth v1 adapter returned malformed JSON with placeholder text. Every Tinker output was 191 characters long. Tinker returned only two distinct responses across the 5 rows, and both are template responses from the training data. The evidence is in results/metrics/side_by_side_comparison.csv and results/metrics/comprehensive_metrics.csv in the GitHub repository.
Charts from the pilot
The charts below show the invalid metrics described above. I kept them as a record of the pilot. Do not read them as evidence of quality.
Metrics the notebook computed
- JSON validity: share of outputs that parse as JSON.
- ROUGE-1, ROUGE-2, ROUGE-L: word and sequence overlap with the reference.
- BERTScore: similarity of contextual embeddings with the reference.
- Sentence-BERT cosine similarity: sentence level similarity with the reference.
- Toxicity: Detoxify score of each output.
- Response length: characters and words per output.
- Composite quality score (from the notebook code,
notebooks/news_analyst_1.py, lines 4621 to 4627): 0.2 Γ ROUGE-1 + 0.2 Γ ROUGE-L + 0.3 Γ BERTScore F1 + 0.2 Γ Sentence-BERT similarity + 0.1 Γ JSON validity.
The notebook did not compute relevance or faithfulness scores.
π₯οΈ Local Use (October 2025)
I merged the Tinker LoRA adapter, imported it into Ollama as llama3.2:newsletter-lora, and pointed my private News Analyst agent at it. That agent is not public, so these steps cannot be reproduced from this repository. The integration test script and deployment logs are not part of this repository or the GitHub repository. Ollama is available at https://ollama.com.
π Documentation
These documents are in the GitHub repository:
- System Architecture: how this fits into the larger news analyst system
- LoRA Comparison: why I chose LoRA over full fine tuning
- Fine-Tuning Configuration: model and training parameters
- Data Preparation: annotation process and data formatting
- Evaluation Methodology: metrics and evaluation process
- Results README: description of the stored result files
These documents date from October 2025. They have not been corrected and still contain claims that this card removed. Treat this card, the GitHub README and the Corrections section as the current record.
π Quick Start
Prerequisites
# Python 3.8+
python --version
# CUDA-capable GPU (for training) or CPU (for inference)
nvidia-smi # Optional: Check GPU availability
Installation
# Clone repository
git clone https://github.com/youshen-lim/llama-tinker-lora-news-enhancer.git
cd llama-tinker-lora-news-enhancer
# Install dependencies
pip install -r requirements.txt
Training Data
The data files are in the GitHub repository.
- Training file: 101 news items (
data/processed/newsletter_train_data.jsonl) - Test file: 246 news items (
data/processed/newsletter_test_data.jsonl) - Total collected: 347 news items (
data/processed/newsletter_training_data.jsonl) - Annotated file: 101 news items with my hand annotations (
data/processed/newsletter_training_annotated.jsonl) - Format: JSONL with user and assistant message pairs
- Assistant targets: The assistant messages in these files use six fixed template responses.
- Hand annotations: My annotations (relevance, topics, companies) sit in a separate
annotationfield. In 97 of the 101 annotated rows, thesummaryannotation is empty. - Evaluation: The notebook scored 5 examples only. The 246 row test file was not the evaluation set. See Results (Pilot, Needs Rerun) above.
# View training data
head -n 5 data/processed/newsletter_train_data.jsonl
Fine-Tuning
Option 1: Tinker API
# See notebooks/News_Analyst_1_Notebook.ipynb for the complete workflow
# 3 epochs on 101 examples. The notebook output does not record the training time.
Option 2: Unsloth (Local)
# See notebooks/News_Analyst_1_Notebook.ipynb for the complete workflow
# Training time: 0.94 minutes for 3 epochs (notebook cell 70)
Inference
This Hugging Face repository holds the Tinker adapter weights (adapter_model.safetensors). The GitHub repository holds only the adapter configuration.
The adapter_config.json in this repository and the GitHub copy both record base_model_name_or_path as unsloth/Llama-3.2-1B, an ungated mirror of meta-llama/Llama-3.2-1B, the base model I trained on. I set this value on November 21, 2026. As of November 21, 2026, Hugging Face shows no configuration parsing warning for this repository. The example below loads the gated Meta base model, so you need approved access to it.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B")
# Load LoRA adapter from Hugging Face
model = PeftModel.from_pretrained(base_model, "Truthseeker87/llama-tinker-lora-news-enhancer")
model = model.merge_and_unload()
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")
# Run inference
news_article = "Your news article text here..."
inputs = tokenizer(news_article, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=500)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
π Project Structure (GitHub Repository)
llama-tinker-lora-news-enhancer/
βββ README.md
βββ LICENSE # MIT License
βββ .env.example
βββ .gitignore
βββ requirements.txt
β
βββ notebooks/
β βββ News_Analyst_1_Notebook.ipynb # Main fine-tuning and evaluation workflow
β βββ news_analyst_1.py # Script export of the notebook
β
βββ scripts/
β βββ news_analyst_1_notebook.py # Python script version
β
βββ src/
β βββ data/annotation_widget.py # Annotation widget
β βββ models/tinker_dataset.py
β βββ models/tinker_dataset_builder.py
β βββ utils/inspect_builder.py
β
βββ data/
β βββ processed/
β βββ newsletter_train_data.jsonl # Training file (101 items)
β βββ newsletter_test_data.jsonl # Test file (246 items)
β βββ newsletter_training_annotated.jsonl # Annotated training items (101 items)
β βββ newsletter_training_data.jsonl # All collected items (347 items)
β
βββ models/
β βββ tinker/tinker_model_latest/
β βββ adapter_config.json # Tinker adapter configuration (weights are on Hugging Face)
β
βββ results/
β βββ metrics/ # Stored pilot results (see Limitations)
β
βββ images/ # Charts used in the README
β
βββ docs/
βββ NEWS_ANALYST_SYSTEM_ARCHITECTURE.md
βββ LORA_COMPARISON.md
βββ FINE_TUNING_CONFIGURATION.md
βββ EVALUATION_METHODOLOGY.md
βββ DATA_PREPARATION.md
This Hugging Face repository holds README.md, adapter_config.json, adapter_model.safetensors and images/ (three PNG charts).
π οΈ Technologies Used
- Base Model: LLaMA 3.2-1B by Meta AI
- Fine-Tuning Method: LoRA (Low-Rank Adaptation) via PEFT
- Training Platforms:
- Tinker API - Managed fine-tuning service
- Unsloth - Optimized local fine-tuning
- Evaluation: ROUGE, BERTScore, Sentence-BERT, JSON validity
- Local inference: Transformers and Ollama
Limitations
- The evaluation scored 5 examples. The results do not support conclusions about quality on new articles.
- The 5 predictions came from rows of the training file, so the evaluation did not use held out articles.
- The evaluation took its references from the separate test file, so the references describe different articles than the predictions. The quality score, ROUGE, BERTScore and Sentence-BERT values are invalid as quality measures and need a rerun.
- The assistant targets in the training and test files are fixed template responses. The Tinker adapter learned to reproduce those templates. Its zero length variation reflects repeated templates, not consistency of analysis.
- My hand annotations sit in a separate
annotationfield. I have not confirmed whether any of them reached the Tinker training targets. - I did not run full fine tuning, so I have no measured comparison between LoRA and full fine tuning.
- I did not record inference time or Tinker training time.
- I did not measure the effect on NotebookLM output.
- The News Analyst agent that uses this adapter is private, so the deployment steps cannot be reproduced from this repository.
- Five JSON result files in
results/metrics/of the GitHub repository (advanced_metrics_*.jsonandcomplete_evaluation_*.json) do not parse. A placeholder string appears inside numeric fields. The placeholder has been present since the initial commit in October 2025. - The documents in
docs/andresults/metrics/README.mdof the GitHub repository date from October 2025 and still contain claims that this card removed. - Version 2 uses a separate 96 item held out test set. See Truthseeker87/llama-tinker-lora-news-enhancer-v2.
Corrections
Corrections (November 21, 2026)
I corrected the following items on this Hugging Face card on November 21, 2026 so that it matches the GitHub README corrected on November 20, 2026. The adapter weights in this repository are unchanged. On November 21, 2026 I changed one field in adapter_config.json: base_model_name_or_path, from an empty value to unsloth/Llama-3.2-1B.
| Item | Previously stated | Corrected to | Cause |
|---|---|---|---|
| Dataset metadata | datasets: custom-ai-newsletter-dataset |
Removed | No public Hugging Face dataset has this ID. The Hub API does not serve it. |
| Metrics metadata | quality_score, json_validity, rouge, bertscore |
Removed | The card now states that these v1 metric values are invalid and need a rerun. |
| Supersession | No notice | Notice that v2 supersedes this pilot | Version 2 replaces this pilot. |
| Evaluation set | Test examples: 20 newsletters | 5 examples scored from training file rows; references from different articles in the 246 row test file | The notebook ran num_samples=5 on the training file. No data file in the GitHub repository holds 20 examples. |
| Results table | Tinker quality score 0.8674, 100% JSON valid, ROUGE-1 0.7714, BERTScore 0.9649, 0.0% CV; "Winner" line | Removed; needs rerun. The 5 output observation is kept as text. | The predictions and references came from different articles, and the references were template strings. |
| Quality score formula | Composite of ROUGE, BERTScore and JSON validation | 0.2 ROUGE-1, 0.2 ROUGE-L, 0.3 BERTScore, 0.2 Sentence-BERT, 0.1 JSON validity | The card did not match the notebook code. |
| Tinker training time | About 2.65 minutes for 3 epochs | Not recorded | No notebook output shows this figure. |
| Benefit multipliers | 3-5x, 10x, 2-3x, 40-60% | Removed | No measurement exists. |
| LoRA vs full fine tuning | Comparison table; 0.5% trainable; 99.5% parameter reduction; 90 to 95% of full fine tuning; 9.2/10 vs 6.0/10 | Removed; Unsloth 0.90% trainable; Tinker not recorded | I never ran full fine tuning. The scores were my own ratings. |
| Architecture | Production system with Tinker and Unsloth branches | Private personal project that uses the Tinker adapter | The Unsloth v1 adapter failed the JSON check and is not used. |
| Inference example | Loads the local path models/tinker/ |
Loads Truthseeker87/llama-tinker-lora-news-enhancer |
The local path does not exist in this repository. |
| Configuration warning | Not mentioned | Notes that both copies of adapter_config.json record unsloth/Llama-3.2-1B since November 21, 2026 |
Before November 21, 2026, Hugging Face reported that peft.base_model_name_or_path must be a string, and the GitHub copy named the invalid ID meta-llama/Llama-2.0-3.2-1B. |
| Clone URL and Project Link | llama-tinker-lora-newsletter | llama-tinker-lora-news-enhancer | Old repository name. |
| External links | tinker.thinking.ai, huggingface.co/transformers | thinkingmachines.ai/tinker, huggingface.co/docs/transformers | The first link fails. The second redirects. |
| Documentation links | Eight docs/ files and results/reports/evaluation_report.md as relative links |
Five existing documents and results/metrics/README.md, linked on GitHub |
The relative links had no target on Hugging Face, and four of the files do not exist on GitHub. |
| Project structure | Tree with a 20 example test file, Unsloth and baseline model folders and eight docs | Actual GitHub file tree, plus the Hugging Face file list | The old tree did not match either repository. |
| Base model license | MIT License only | MIT License for the repository files; Llama 3.2 Community License for the Llama 3.2 base model | The card did not name the license of the base model. |
I checked these items against the GitHub README and against the live file list of this Hugging Face repository. The full record of the November 20, 2026 README corrections follows.
Corrections (November 20, 2026, GitHub README)
I corrected the following items in the GitHub README on November 20, 2026 after I rechecked it against the notebook, the data files and the result files in the GitHub repository. The data, adapter weights and evaluation code are unchanged. On November 21, 2026 I changed one field in the adapter configuration, base_model_name_or_path, to unsloth/Llama-3.2-1B.
| Item | Previously stated | Corrected to | Cause |
|---|---|---|---|
| Evaluation set | 246 test articles; evaluation on reference based metrics | 5 examples scored; predictions from training file rows; references from different test file articles | The notebook ran num_samples=5 on the training file and then took references from the 246 row test file. The 246 figure is the size of the test file. |
| Quality score | 0.8674 vs 0.3302 base | Removed; needs rerun | The predictions and references came from different articles, and the references were template strings. |
| Quality improvement | +162% quality improvement | Removed; needs rerun | Same cause as the quality score. |
| ROUGE-1 | 0.7714 vs 0.0501 base (+1439%) | Removed; needs rerun | Same cause as the quality score. |
| BERTScore | 0.9649 vs 0.8003 base (+20%) | Removed; needs rerun | Same cause as the quality score. |
| Quality score formula | 0.25, 0.15, 0.15, 0.20, 0.15, 0.10 weights over six metrics | 0.2 ROUGE-1, 0.2 ROUGE-L, 0.3 BERTScore, 0.2 Sentence-BERT, 0.1 JSON validity | The README formula did not match the notebook code. |
| Consistency | 45.2% CV to 0.0% CV; "Perfect Consistency" | Removed | The files give different base values. Zero variation reflected repeated template responses. |
| Inference time | 5.1 seconds per article; about 51 seconds for 10 articles | Removed | No measurement exists in the repository. |
| Tinker training time | 2.65 minutes | Not recorded | No notebook output shows this figure. |
| Trainable parameters | 0.5% trainable; 99.5% parameter reduction | Unsloth 0.90%; Tinker not recorded | The Unsloth notebook output reports 0.90%. No output records the Tinker figure. |
| LoRA vs full fine tuning | Memory, speed, size and data tables; 90 to 95% of full fine tuning; 9.2/10 vs 6.0/10 | Removed | I never ran full fine tuning. The scores were my own ratings. |
| Ollama vs llama.cpp | Load time, tokens per second and latency figures; llama.cpp "Command-line only" | Removed | I did not benchmark either tool. llama.cpp also ships an HTTP server. |
| Benefit multipliers | 3-5x, 10x, 2-3x, 40-60% | Removed | No measurement exists. |
| Status | Production Ready; Risk Level LOW; zero issues; Gaps NONE | Removed | The results do not support these statements. |
| Deployment claims | 8 phases complete; integration tests 4/4; workspace cleanup counts | Replaced with a short local use note | The test script, logs and workspace are not part of this repository. |
| Architecture | Production system with Tinker and Unsloth branches | Private personal project that uses the Tinker adapter | The Unsloth v1 adapter failed the JSON check and is not used. |
| Broken links | 21 missing documents and scripts | Removed | The files do not exist in this repository. |
| Inference example | Loads the local path models/tinker/ |
Loads the Hugging Face adapter | The local path holds no weights. |
| Clone URL | llama-tinker-lora-newsletter | llama-tinker-lora-news-enhancer | Old repository name. |
| External links | tinker.thinking.ai, ollama.ai, huggingface.co/transformers | thinkingmachines.ai/tinker, ollama.com, huggingface.co/docs/transformers | The first link fails. The other two redirect. |
I rechecked the file counts (101, 246 and 347 items), the six template targets, the 5 example evaluation and the Unsloth training time and trainable parameters against the notebook and data files in the GitHub repository.
π€ Contributing
Contributions are welcome! Please:
- Fork the GitHub repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License. See the LICENSE file in the GitHub repository for details.
The MIT License covers only the files in this repository. The Llama 3.2 Community License governs the Llama 3.2 base model (meta-llama/Llama-3.2-1B).
π Acknowledgments
- Meta AI for LLaMA 3.2-1B base model
- Thinking Machines for Tinker API managed fine-tuning service
- Unsloth for optimized local fine-tuning library
- Hugging Face for Transformers and PEFT libraries
π§ Contact
Aaron (Youshen) Lim - @youshen-lim
Project Link: https://github.com/youshen-lim/llama-tinker-lora-news-enhancer
β If you find this project useful, please consider giving it a star!
- Downloads last month
- 8
Model tree for Truthseeker87/llama-tinker-lora-news-enhancer
Base model
meta-llama/Llama-3.2-1B
