Text Generation
Transformers
Safetensors
English
financial-analysis
covenant-extraction
llama
lora
conversational
Eval Results (legacy)
Instructions to use meadhikari/covenant-extractor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meadhikari/covenant-extractor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meadhikari/covenant-extractor") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("meadhikari/covenant-extractor", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use meadhikari/covenant-extractor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meadhikari/covenant-extractor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meadhikari/covenant-extractor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meadhikari/covenant-extractor
- SGLang
How to use meadhikari/covenant-extractor 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 "meadhikari/covenant-extractor" \ --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": "meadhikari/covenant-extractor", "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 "meadhikari/covenant-extractor" \ --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": "meadhikari/covenant-extractor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meadhikari/covenant-extractor with Docker Model Runner:
docker model run hf.co/meadhikari/covenant-extractor
Covenant Extractor Model
This model is fine-tuned on Llama-3.2-3B-Instruct for extracting and structuring financial covenants from credit agreements into standardized JSON format.
Model Description
- Base Model: meta-llama/Llama-3.2-3B-Instruct
- Task: Financial Covenant Extraction
- Training Method: LoRA Fine-tuning
- Language: English
- License: Same as base model
Intended Use
This model is designed to:
- Extract covenant details from credit agreement sections
- Structure the information into standardized JSON format
- Handle various types of financial covenants (leverage ratios, coverage ratios, etc.)
Input Format
### Instruction: Extract covenant details from the following credit agreement section and structure it into JSON format only.
### Input: Section 4.2:
The Borrower shall maintain a Fixed Charge Coverage Ratio of not less than 1.25:1.00 for any fiscal quarter ending after June 30, 2024.
### Response:
Output Format
{
"type": "financial",
"category": "fixed_charge_coverage_ratio",
"section": "4.2",
"requirements": {
"threshold": "1.25:1.00",
"measurement_period": "quarterly",
"timeline": ["June 30, 2024"]
}
}
Training Details
- Training Method: LoRA (Low-Rank Adaptation)
- LoRA Config:
- Rank: 16
- Alpha: 32
- Target Modules: q_proj, k_proj, v_proj, o_proj
- Dropout: 0.1
- Training Parameters:
- Batch Size: 4
- Gradient Accumulation Steps: 16
- Learning Rate: 1e-4
- Number of Epochs: 3
- Weight Decay: 0.01
- Max Gradient Norm: 1.0
Limitations
- Only processes English language credit agreements
- Best suited for standard financial covenants
- May require adjustment for complex or non-standard covenant structures
Citation
If you use this model in your work, please cite:
@misc{covenant-extractor,
author = {[Bikram Adhikari]},
title = {Covenant Extractor: Fine-tuned LLM for Financial Covenant Analysis},
year = {2024}
}
Evaluation results
- Test Accuracyself-reported90.000