How to use from
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 "muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft" \
    --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": "muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft",
		"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 "muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft" \
        --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": "muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

Llama-base-3.1-8B-invoice-gguf-sft

A fine-tuned Llama-3.1-8B model optimized for invoice understanding and extraction.
This version is exported in GGUF format for performant inference with tools such as llama.cpp, Ollama, and text-generation-ui.


Model Details

Model Description

This model adapts Llama-3.1-8B for structured invoice field extraction.
The goal is to support tasks such as reading invoice text and identifying key fields (amount, date, vendor, tax, line items, etc.).

  • Developed by: muhammed-afsal-p-m
  • Model type: Auto-regressive language model (decoder-only)
  • Languages: English (primary) — Other languages not verified
  • License: Fill in — e.g., MIT, Apache-2.0, others
  • Fine-tuned from: Llama-3.1-8B (Meta)

Model Sources


Uses

Direct Use

Useful for:

  • Invoice text understanding
  • Extracting structured fields
  • Document parsing prototypes
  • Local inference via GGUF

Downstream Use

Can be integrated into:

  • RPA invoice pipelines
  • Accounting automation
  • OCR → LLM extraction stages
  • Document indexing/search systems

Out-of-Scope Use

Not suited for:

  • Legal/financial decision-making without human review
  • High-stakes extraction requiring guaranteed accuracy
  • Multi-language invoice parsing (not validated)
  • Vision-based tasks (requires text extracted separately)

Bias, Risks, and Limitations

  • Model accuracy depends heavily on the quality and consistency of invoice text.
  • May hallucinate missing fields instead of explicitly stating absence.
  • Invoices vary widely in structure; unseen formats may reduce reliability.
  • Any training biases (invoice styles, languages, domain distribution) affect output.

Recommendations

  • Always verify extracted results.
  • Use deterministic decoding when consistent outputs are required.
  • Validate outputs with rule-based post-processing.

How to Get Started

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_name = "muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft"

# For GGUF, use llama.cpp / ctransformers:
from ctransformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    model_file="model.gguf",  # replace with your file name
)
print(model("Extract invoice total from: ..."))
Downloads last month
38
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support