Instructions to use sarathi-balakrishnan/llama-agri-b2b-intelligence-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sarathi-balakrishnan/llama-agri-b2b-intelligence-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sarathi-balakrishnan/llama-agri-b2b-intelligence-merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sarathi-balakrishnan/llama-agri-b2b-intelligence-merged") model = AutoModelForCausalLM.from_pretrained("sarathi-balakrishnan/llama-agri-b2b-intelligence-merged", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sarathi-balakrishnan/llama-agri-b2b-intelligence-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sarathi-balakrishnan/llama-agri-b2b-intelligence-merged
- SGLang
How to use sarathi-balakrishnan/llama-agri-b2b-intelligence-merged with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sarathi-balakrishnan/llama-agri-b2b-intelligence-merged with Docker Model Runner:
docker model run hf.co/sarathi-balakrishnan/llama-agri-b2b-intelligence-merged
Llama 3.1 8B โ Agricultural B2B Intelligence (merged weights, experiment)
Built with Llama.
Personal experiment (December 2025). This repo contains the LoRA adapter from llama-agri-b2b-intelligence merged into Llama-3.1-8B-Instruct, so it loads without PEFT. The full training details, data provenance, and limitations are on the adapter card. It has only been evaluated by loss. No task benchmark yet.
Merged vs adapter
| This repo (merged) | LoRA adapter repo | |
|---|---|---|
| Download size | ~16 GB (8.03B params in BF16) | 1.34 GB adapter + the base model |
| Needs PEFT | No | Yes |
| Inference cost | Same as base Llama-3.1-8B | Small extra matmuls per layer unless merged |
| Outputs | Equivalent to the adapter, up to BF16 rounding from the merge | โ |
| Good for | GGUF conversion, Ollama, plain transformers |
Storage-limited setups, swapping adapters |
Merging folds the low-rank update into each weight, Wโฒ = W + (ฮฑ/r)ยทBยทA. After that the model runs at exactly the base model's cost. I haven't benchmarked the adapter-vs-merged speed difference, so I make no speed-up claim here.
Quick start
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "sarathi-balakrishnan/llama-agri-b2b-intelligence-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "system", "content": "You are an agricultural business intelligence analyst."},
{"role": "user", "content": "Analyze corn market opportunities in Iowa for a seed company."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1000, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Convert to GGUF for llama.cpp / Ollama
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp && pip install -r requirements.txt
huggingface-cli download sarathi-balakrishnan/llama-agri-b2b-intelligence-merged \
--local-dir ./agri-b2b-merged
python convert_hf_to_gguf.py ./agri-b2b-merged --outfile agri-b2b-q8.gguf --outtype q8_0
cat > Modelfile <<'MF'
FROM ./agri-b2b-q8.gguf
SYSTEM "You are an agricultural business intelligence analyst."
MF
ollama create agri-b2b -f Modelfile
ollama run agri-b2b
I haven't measured tokens/s on Apple Silicon or other local hardware for this model.
Training summary (details on the adapter card)
| Method | LoRA SFT on teacher-generated responses (sequence-level distillation) |
| Teacher outputs | 5,007 Claude Sonnet 4 + 4,993 GPT-4.1 (10,000 examples) |
| LoRA | r = 128, ฮฑ = 256, all 7 projections, 335.5M trainable params before merging |
| Hardware / time | 1ร NVIDIA DGX Spark (GB10), ~55 h, 3 epochs |
| Final loss | train ~0.70, validation ~0.78 |
| Task benchmark | Pending |
About the teacher data. The training targets are outputs from third-party models. Use of this model is also subject to the terms of the providers whose models generated them (Anthropic and OpenAI), in addition to the Llama 3.1 Community License. Please review those terms for your use case.
Limitations
Not benchmarked. Trained on unverified synthetic answers, so statistics in outputs can be invented. US-only, English-only. Not for regulatory, lending, insurance, investment, or trading decisions.
License
Distributed under the Llama 3.1 Community License, subject to Meta's Acceptable Use Policy. Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright ยฉ Meta Platforms, Inc. All Rights Reserved.
Citation
@misc{llama-agri-b2b-intelligence-merged-2025,
title = {Llama 3.1 8B Agricultural B2B Intelligence (merged): a sequence-level distillation experiment},
author = {Sarathi Balakrishnan},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/sarathi-balakrishnan/llama-agri-b2b-intelligence-merged}
}
- Downloads last month
- -
Model tree for sarathi-balakrishnan/llama-agri-b2b-intelligence-merged
Base model
meta-llama/Llama-3.1-8B