Text Generation
Transformers
Safetensors
English
mistral
causal-lm
qlora
merged-lora
mathematics
logic
principia-mathematica
research
text-generation-inference
Instructions to use clarkkitchen22/PrincipiaMistralModel7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use clarkkitchen22/PrincipiaMistralModel7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="clarkkitchen22/PrincipiaMistralModel7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("clarkkitchen22/PrincipiaMistralModel7B") model = AutoModelForCausalLM.from_pretrained("clarkkitchen22/PrincipiaMistralModel7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use clarkkitchen22/PrincipiaMistralModel7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "clarkkitchen22/PrincipiaMistralModel7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "clarkkitchen22/PrincipiaMistralModel7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/clarkkitchen22/PrincipiaMistralModel7B
- SGLang
How to use clarkkitchen22/PrincipiaMistralModel7B 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 "clarkkitchen22/PrincipiaMistralModel7B" \ --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": "clarkkitchen22/PrincipiaMistralModel7B", "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 "clarkkitchen22/PrincipiaMistralModel7B" \ --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": "clarkkitchen22/PrincipiaMistralModel7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use clarkkitchen22/PrincipiaMistralModel7B with Docker Model Runner:
docker model run hf.co/clarkkitchen22/PrincipiaMistralModel7B
| language: | |
| - en | |
| license: apache-2.0 | |
| tags: | |
| - mistral | |
| - causal-lm | |
| - text-generation | |
| - qlora | |
| - merged-lora | |
| - mathematics | |
| - logic | |
| - principia-mathematica | |
| - research | |
| pipeline_tag: text-generation | |
| base_model: mistralai/Mistral-7B-v0.1 | |
| model_type: mistral | |
| library_name: transformers | |
| model_creator: clarkkitchen22 | |
| # PrincipiaMistralModel7B | |
| **PrincipiaMistralModel7B** is a 7B-parameter causal language model based on **Mistral-7B-v0.1**, fine-tuned via **QLoRA** on a custom corpus of logic- and math-focused text inspired by *Principia Mathematica* and related foundational material. | |
| The goal of this model is to bias Mistral-7B toward: | |
| - More **formal reasoning** about implications and basic proof structures | |
| - Better familiarity with **symbolic logic notation** | |
| - Explanations of classical foundations-of-mathematics ideas in clear English | |
| This checkpoint is a **fully merged model** (LoRA merged into base), so it can be loaded directly with `AutoModelForCausalLM` without PEFT. | |
| --- | |
| ## Model Details | |
| - **Base model:** `mistralai/Mistral-7B-v0.1` | |
| - **Architecture:** Transformer (GQA + sliding window attention, as in Mistral-7B) | |
| - **Parameters:** ~7B | |
| - **Library:** Hugging Face `transformers` | |
| - **Finetuning method:** QLoRA (low-rank adapters, later merged into full weights) | |
| - **Precision:** Saved as `safetensors` sharded across 3 files | |
| --- | |
| ## Intended Use | |
| ### Primary use cases | |
| - Educational / research exploration of: | |
| - Basic propositional logic (e.g. implications, modus ponens, simple derivations) | |
| - Foundations-of-mathematics style narratives (inspired by *Principia Mathematica*) | |
| - Explanations of logic and proof ideas for students or hobbyists | |
| - As a **component model** inside agents/tools that: | |
| - Need slightly more structured, formal reasoning than a generic base model | |
| - Work with simple proof sketches, logical implications, or math-adjacent text | |
| ### Not intended for | |
| - High-stakes decision making (finance, medicine, law, safety-critical systems) | |
| - Use as a fully robust automated theorem prover | |
| - Use without human oversight in any domain that affects real people’s lives | |
| --- | |
| ## Training & Data (High Level) | |
| - **Method:** QLoRA fine-tuning on top of `mistralai/Mistral-7B-v0.1`, then weights merged. | |
| - **Hardware:** Single consumer GPU (e.g., NVIDIA RTX 2070-class) | |
| - **Epochs:** ~1 epoch over the custom dataset (light, targeted fine-tune) | |
| - **Data:** | |
| - Text inspired by *Principia Mathematica*–style logic and foundational mathematics | |
| - Simple logical implication examples and step-by-step reasoning prompts | |
| - Explanations of core foundational concepts in natural language | |
| This is a **research/learning project**, not a benchmark-optimized or industrially aligned model. | |
| --- | |
| ## How to Use | |
| ### Basic loading (Transformers) | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| import torch | |
| model_id = "clarkkitchen22/PrincipiaMistralModel7B" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.float16, | |
| device_map="auto", | |
| ) | |
| prompt = ( | |
| "We work in a simple propositional calculus.\n\n" | |
| "Premises:\n" | |
| " (1) p -> q\n" | |
| " (2) q -> r\n" | |
| "Conclusion:\n" | |
| " (3) p -> r\n\n" | |
| "Explain, step by step, why (3) follows from (1) and (2)." | |
| ) | |
| inputs = tokenizer(prompt, return_tensors="pt").to(model.device) | |
| with torch.no_grad(): | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=160, | |
| do_sample=True, | |
| top_p=0.9, | |
| temperature=0.3, | |
| repetition_penalty=1.15, | |
| ) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |
| --- | |
| license: apache-2.0 | |
| --- | |