Text Generation
Transformers
Safetensors
PEFT
English
archimate
llama3
causal-lm
lora
conversational
Eval Results (legacy)
Instructions to use brkichle/lora-llama3-archimate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use brkichle/lora-llama3-archimate with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="brkichle/lora-llama3-archimate") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("brkichle/lora-llama3-archimate", dtype="auto") - PEFT
How to use brkichle/lora-llama3-archimate with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use brkichle/lora-llama3-archimate with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "brkichle/lora-llama3-archimate" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "brkichle/lora-llama3-archimate", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/brkichle/lora-llama3-archimate
- SGLang
How to use brkichle/lora-llama3-archimate 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 "brkichle/lora-llama3-archimate" \ --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": "brkichle/lora-llama3-archimate", "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 "brkichle/lora-llama3-archimate" \ --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": "brkichle/lora-llama3-archimate", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use brkichle/lora-llama3-archimate with Docker Model Runner:
docker model run hf.co/brkichle/lora-llama3-archimate
| # handler.py | |
| import os | |
| from typing import Dict, Any, List, Union | |
| from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline | |
| from peft import PeftModel | |
| import torch | |
| class EndpointHandler: | |
| def __init__(self, path: str = ""): | |
| # Load tokenizer and base model | |
| model_id = path or os.getenv("HF_MODEL_ID") | |
| self.tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=True) | |
| base_model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| device_map="auto", | |
| torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, | |
| ) | |
| # Load LoRA adapter | |
| self.model = PeftModel.from_pretrained(base_model, model_id) | |
| self.model.eval() | |
| self.model.config.use_cache = True | |
| # Create text-generation pipeline | |
| self.pipe = pipeline( | |
| "text-generation", | |
| model=self.model, | |
| tokenizer=self.tokenizer, | |
| device_map="auto", | |
| return_full_text=False, | |
| ) | |
| def __call__( | |
| self, | |
| request: Union[Dict[str, Any], List[Dict[str, Any]]] | |
| ) -> List[Dict[str, str]]: | |
| # Normalize to list of request dicts | |
| reqs = request if isinstance(request, list) else [request] | |
| responses: List[Dict[str, str]] = [] | |
| for req in reqs: | |
| # Support 'inputs' or 'prompt' | |
| raw = req.get("inputs") or req.get("prompt") | |
| if raw is None: | |
| raise ValueError("No 'inputs' or 'prompt' field in request") | |
| # Normalize to list of strings | |
| texts: List[str] = raw if isinstance(raw, list) else [raw] | |
| params = req.get("parameters", {}) | |
| # Ensure pad_token_id set | |
| if "pad_token_id" not in params: | |
| params["pad_token_id"] = self.tokenizer.eos_token_id | |
| for text in texts: | |
| # Generate | |
| out = self.pipe(text, **params) | |
| # pipeline returns list of dicts [{'generated_text': ...}] | |
| if isinstance(out, list) and out and isinstance(out[0], dict): | |
| responses.append({"generated_text": out[0]["generated_text"].strip()}) | |
| else: | |
| # Fallback: stringify | |
| responses.append({"generated_text": str(out).strip()}) | |
| return responses | |