Text Generation
Transformers
Safetensors
PEFT
maeyen-trust-risk-assistant
lora
maeyen
risk-assessment
trust-score
dispute-management
evidence-review
Instructions to use tarvico/maeyen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tarvico/maeyen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tarvico/maeyen")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("tarvico/maeyen", dtype="auto") - PEFT
How to use tarvico/maeyen with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tarvico/maeyen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tarvico/maeyen" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tarvico/maeyen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tarvico/maeyen
- SGLang
How to use tarvico/maeyen 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 "tarvico/maeyen" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tarvico/maeyen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "tarvico/maeyen" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tarvico/maeyen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tarvico/maeyen with Docker Model Runner:
docker model run hf.co/tarvico/maeyen
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| from peft import PeftModel | |
| import json | |
| import os | |
| # For internal use: base model details are in PRIVATE_MODEL_TRAINING_NOTES.md | |
| def load_maeyen_assistant(model_path): | |
| """Load Maeyen Trust & Risk Assistant (internal use only)""" | |
| # See PRIVATE_MODEL_TRAINING_NOTES.md for base model info | |
| print("Loading tokenizer...") | |
| tokenizer = AutoTokenizer.from_pretrained(model_path) | |
| tokenizer.pad_token = tokenizer.eos_token | |
| print("Loading model...") | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_path, | |
| device_map="cpu" # or "auto" if GPU available | |
| ) | |
| return model, tokenizer | |
| def generate_recommendation(model, tokenizer, task, data): | |
| """Generate structured recommendation from Maeyen AI""" | |
| system_prompts = { | |
| "risk": "You are Maeyen AI Transaction Risk Agent. Assess risk and output valid JSON only with requires_human_review: true.", | |
| "evidence": "You are Maeyen AI Evidence Review Agent. Review evidence and output valid JSON only with requires_human_review: true.", | |
| "dispute": "You are Maeyen AI Dispute Assistant. Summarize dispute and output valid JSON only with requires_human_review: true.", | |
| "trust": "You are Maeyen AI Trust Score Explanation Agent. Explain trust score and output valid JSON only." | |
| } | |
| system_prompt = system_prompts.get(task, system_prompts["risk"]) | |
| prompt = f"""<|im_start|>system | |
| {system_prompt}<|im_end|> | |
| <|im_start|>user | |
| {json.dumps(data, indent=2)}<|im_end|> | |
| <|im_start|>assistant | |
| """ | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| with torch.no_grad(): | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=512, | |
| temperature=0.1, | |
| do_sample=False, | |
| pad_token_id=tokenizer.eos_token_id | |
| ) | |
| response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True) | |
| try: | |
| return json.loads(response) | |
| except json.JSONDecodeError: | |
| return {"raw_response": response, "requires_human_review": True} | |
| # Example usage (internal only) | |
| if __name__ == "__main__": | |
| # Note: See PRIVATE_MODEL_TRAINING_NOTES.md for full setup | |
| print("This is for internal use. See PRIVATE_MODEL_TRAINING_NOTES.md for base model details.") | |