Llama-3.1-8B-Computer-Networks-LLM

GitHub Repo Model Weights License


🔍 Model Description

Fine-tuned from: meta-llama/Llama-3.1-8B-Instruct

Domain specialization: Computer networking with enhanced capabilities in:

  • Network protocol explanations (OSPF, BGP, TCP/IP stack)
  • Configuration template generation
  • Troubleshooting scenarios
  • Security best practices
  • RFC interpretation

Installation & Usage

Using Hugging Face Directly (Recommended)

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
from transformers import BitsAndBytesConfig

quant_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_compute_dtype=torch.float16
)

model = AutoModelForCausalLM.from_pretrained(
    "Irfanuruchi/Llama-3.1-8B-Computer-Networks-LLM",
    quantization_config=quant_config,
    torch_dtype=torch.float16,
    device_map="auto",
    trust_remote_code=True
)

tokenizer = AutoTokenizer.from_pretrained("Irfanuruchi/Llama-3.1-8B-Computer-Networks-LLM")

prompt = """You are a network engineering expert. Answer concisely:
Q: What's the difference between TCP and UDP protocols?
A:"""


inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Local installation (GitHub):


git clone https://github.com/IrfanUruchi/Llama-3.1-8B-Computer-Networks-LLM.git
cd Llama-3.1-8B-Computer-Networks-LLM

The large safetensor model shards are not stored in the Github repository. Instead i have hosted them in MEGA , there are 6 files totalling around 11GB :

After downloading , place all the safetensors files into the folder with the other configuration file in your local copy of the repository. Ensure that the model loading scripts point to the correct directory.

Run inference localy (follow tutorial on GitHub for more details)

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

MODEL_PATH = "./model"  # Path to downloaded model files

tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_PATH,
    device_map="auto",
    trust_remote_code=True
)

prompt = (
    "As a network specialist, explain in detail:\n\n"
    "Q: How does BGP path selection work in large-scale networks?\n"
    "A:"
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=200,
    temperature=0.7,
    do_sample=True
)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Licence compliance

This model inherits Meta's LLaMA 3.1 License. Users must:

Accept Meta's license terms Use only for non-commercial research Provide attribution to both Meta and this project


Contributions are welcome!

Downloads last month
27
Safetensors
Model size
8.03B params
Tensor type
F32
·
I8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Irfanuruchi/Llama-3.1-8B-Computer-Networks-LLM

Quantized
(472)
this model