Instructions to use Rakshi1511/finedgar-gemma-4-e2b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Rakshi1511/finedgar-gemma-4-e2b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-e2b-it") model = PeftModel.from_pretrained(base_model, "Rakshi1511/finedgar-gemma-4-e2b-lora") - Transformers
How to use Rakshi1511/finedgar-gemma-4-e2b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Rakshi1511/finedgar-gemma-4-e2b-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Rakshi1511/finedgar-gemma-4-e2b-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Rakshi1511/finedgar-gemma-4-e2b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Rakshi1511/finedgar-gemma-4-e2b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Rakshi1511/finedgar-gemma-4-e2b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Rakshi1511/finedgar-gemma-4-e2b-lora
- SGLang
How to use Rakshi1511/finedgar-gemma-4-e2b-lora 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 "Rakshi1511/finedgar-gemma-4-e2b-lora" \ --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": "Rakshi1511/finedgar-gemma-4-e2b-lora", "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 "Rakshi1511/finedgar-gemma-4-e2b-lora" \ --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": "Rakshi1511/finedgar-gemma-4-e2b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Rakshi1511/finedgar-gemma-4-e2b-lora with Docker Model Runner:
docker model run hf.co/Rakshi1511/finedgar-gemma-4-e2b-lora
FinEdgar Gemma 4 E2B LoRA
This repository contains a LoRA adapter fine-tuned for question answering over SEC filings.
The adapter is intended to be used inside a retrieval-augmented financial QA system. It was trained to answer with filing-grounded context and to work alongside deterministic XBRL tooling for structured financial facts.
Base Model
- Base model:
google/gemma-4-e2b-it - Adapter type: LoRA
- PEFT version:
0.18.1 - Task type: causal language modeling
Users must have access to the base model and comply with the base model license and terms.
Intended Use
This adapter is intended for:
- SEC filing question answering
- filing-grounded financial summaries
- structured financial QA when paired with XBRL facts
- local RAG pipelines over 10-K, 10-Q, and 8-K filings
It is not intended to be used as a standalone source of financial truth. Numeric answers should be checked against SEC XBRL facts or the original filing.
Out-of-Scope Use
Do not use this model as financial advice, investment advice, accounting advice, legal advice, or a substitute for reviewing original SEC filings.
The model can be wrong when retrieval context is missing, incomplete, stale, or ambiguous.
Training Data
Training used a mixture of:
- financial QA examples
- financial sentiment examples
- SEC/XBRL-derived synthetic QA
- filing-diff summary examples
FinanceBench was used for evaluation and was not used as direct training supervision.
Evaluation
Latest tracked FinanceBench result from the project evaluation run:
| Metric | Result |
|---|---|
| Overall accuracy | 40.7% |
| XBRL route accuracy | 40.0% |
| RAG route accuracy | 41.1% |
| Recall@5 | 30.0% |
| Average latency | 2,144 ms |
Evaluation file: eval_latest_model_20260414.json
These results are system-level results from the full FinEdgar pipeline, not adapter-only generation in isolation.
Limitations
- The adapter depends on good retrieval context.
- It can produce incomplete narrative answers when evidence is spread across multiple filings or sections.
- It may format or reason about financial metrics incorrectly without deterministic XBRL support.
- It does not know current market prices or events unless those are provided in context.
- It should be used with citations and source checking.
Loading
Example PEFT loading pattern:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = "google/gemma-4-e2b-it"
adapter = "YOUR_USERNAME/finedgar-gemma-4-e2b-lora"
tokenizer = AutoTokenizer.from_pretrained(adapter)
model = AutoModelForCausalLM.from_pretrained(base_model)
model = PeftModel.from_pretrained(model, adapter)
Depending on the installed Transformers version and Gemma 4 support, a model-specific class or processor may be required instead of AutoModelForCausalLM.
Suggested Inference Pattern
Use the model with retrieved filing context:
Question: <user question>
Context:
<retrieved SEC filing excerpts with citations>
Answer using only the provided context. If the answer is not present, say so.
For structured metrics, prefer XBRL lookup and use generation only for explanation or formatting.
- Downloads last month
- 12