Text Generation
Transformers
Safetensors
PEFT
English
mistral
fine-tuned
qlora
lora
llm
instruction-tuning
conversational
text-generation-inference
Instructions to use FazeFlynn/mistral-7b-llm-architecture-expert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FazeFlynn/mistral-7b-llm-architecture-expert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FazeFlynn/mistral-7b-llm-architecture-expert") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("FazeFlynn/mistral-7b-llm-architecture-expert") model = AutoModelForMultimodalLM.from_pretrained("FazeFlynn/mistral-7b-llm-architecture-expert") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - PEFT
How to use FazeFlynn/mistral-7b-llm-architecture-expert with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FazeFlynn/mistral-7b-llm-architecture-expert with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FazeFlynn/mistral-7b-llm-architecture-expert" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FazeFlynn/mistral-7b-llm-architecture-expert", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FazeFlynn/mistral-7b-llm-architecture-expert
- SGLang
How to use FazeFlynn/mistral-7b-llm-architecture-expert 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 "FazeFlynn/mistral-7b-llm-architecture-expert" \ --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": "FazeFlynn/mistral-7b-llm-architecture-expert", "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 "FazeFlynn/mistral-7b-llm-architecture-expert" \ --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": "FazeFlynn/mistral-7b-llm-architecture-expert", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FazeFlynn/mistral-7b-llm-architecture-expert with Docker Model Runner:
docker model run hf.co/FazeFlynn/mistral-7b-llm-architecture-expert
Mistral-7B LLM Architecture Expert
A fine-tuned version of Mistral-7B-Instruct-v0.3 trained using QLoRA on a custom dataset focused on LLM architecture concepts and internals.
Topics covered include:
- Attention mechanisms
- Transformers
- Training dynamics
- Scaling laws
- KV cache
- Tokenization
- Fine-tuning methods
- LLM evaluation
Training Details
| Parameter | Value |
|---|---|
| Base model | mistralai/Mistral-7B-Instruct-v0.3 |
| Method | QLoRA (NF4 4-bit + LoRA) |
| Dataset | 500 custom instruction examples |
| Domain | LLM Architecture |
| LoRA Rank | 64 |
| Trainable Parameters | 2.26% |
| Optimizer | Paged AdamW |
| Learning Rate Schedule | Cosine + 3% warmup |
| Final Training Loss | 1.2629 |
| Training Time | ~3.3 minutes |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "FazeFlynn/mistral-7b-llm-architecture-expert"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16
)
prompt = "[INST] Explain how KV cache works in transformers [/INST]"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=200
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 97
Model tree for FazeFlynn/mistral-7b-llm-architecture-expert
Base model
mistralai/Mistral-7B-v0.3 Finetuned
mistralai/Mistral-7B-Instruct-v0.3