Text Generation
Transformers
Safetensors
English
llama
maritime
navigation
merged
maritime-navigation
seamanship
nautical
conversational
text-generation-inference
Instructions to use pentagoniac/llamarine with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pentagoniac/llamarine with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pentagoniac/llamarine") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pentagoniac/llamarine") model = AutoModelForCausalLM.from_pretrained("pentagoniac/llamarine", device_map="auto") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pentagoniac/llamarine with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pentagoniac/llamarine" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pentagoniac/llamarine", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/pentagoniac/llamarine
- SGLang
How to use pentagoniac/llamarine 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 "pentagoniac/llamarine" \ --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": "pentagoniac/llamarine", "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 "pentagoniac/llamarine" \ --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": "pentagoniac/llamarine", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use pentagoniac/llamarine with Docker Model Runner:
docker model run hf.co/pentagoniac/llamarine
| license: llama2 | |
| base_model: meta-llama/Llama-3.1-70B | |
| tags: | |
| - maritime | |
| - navigation | |
| - llama | |
| - merged | |
| - maritime-navigation | |
| - seamanship | |
| - nautical | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| # π Llamarine - Maritime Navigation Model | |
| Llamarine is a specialized large language model fine-tuned for maritime navigation and seamanship. This is a merged version combining the base Llama-3.1-70B model with maritime-specific LoRA adapters. | |
| ## π’ Model Details | |
| - **Base Model**: meta-llama/Llama-3.1-70B | |
| - **Specialization**: Maritime navigation, seamanship, and nautical operations | |
| - **Model Type**: Merged (base + LoRA adapters) | |
| - **Model Size**: ~70.6B parameters | |
| - **Precision**: bfloat16 | |
| - **Context Length**: 128k tokens | |
| ## β Maritime Capabilities | |
| This model excels in: | |
| ### π§ Navigation & Piloting | |
| - Celestial navigation principles | |
| - GPS and electronic navigation | |
| - Dead reckoning and position fixing | |
| - Chart reading and interpretation | |
| - Compass navigation and deviation | |
| - Tide and current calculations | |
| ### π₯οΈ Ship Operations | |
| - Anchoring procedures and techniques | |
| - Docking and undocking maneuvers | |
| - Ship handling in various conditions | |
| - Cargo operations and stability | |
| - Emergency procedures | |
| ### π‘ Maritime Communications | |
| - Radio protocols and procedures | |
| - Distress and safety communications | |
| - Port communications | |
| - International signal codes | |
| ### βοΈ Maritime Law & Regulations | |
| - International collision regulations (COLREGS) | |
| - Maritime traffic separation schemes | |
| - Port state control requirements | |
| - International maritime conventions | |
| ### π Weather & Oceanography | |
| - Weather routing and planning | |
| - Ocean currents and their effects | |
| - Storm avoidance techniques | |
| - Barometric pressure interpretation | |
| ## π Usage | |
| ### Using Transformers | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| import torch | |
| # Load model and tokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("pentagoniac/llamarine") | |
| model = AutoModelForCausalLM.from_pretrained( | |
| "pentagoniac/llamarine", | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto" | |
| ) | |
| # Generate response | |
| prompt = "What is dead reckoning navigation?" | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=200, | |
| temperature=0.7, | |
| top_p=0.9, | |
| do_sample=True | |
| ) | |
| response = tokenizer.decode(outputs[0], skip_special_tokens=True) | |
| print(response) | |
| ``` | |
| ### Using vLLM (Recommended for Production) | |
| ```python | |
| from vllm import LLM, SamplingParams | |
| # Initialize model | |
| llm = LLM( | |
| model="pentagoniac/llamarine", | |
| tensor_parallel_size=2, # Adjust based on your GPU setup | |
| dtype="bfloat16", | |
| gpu_memory_utilization=0.95, # Use 95% of GPU memory | |
| max_model_len=8192 # Large context length for extended conversations | |
| ) | |
| # Configure sampling | |
| sampling_params = SamplingParams( | |
| temperature=0.7, | |
| top_p=0.9, | |
| max_tokens=2000 | |
| ) | |
| # Generate response | |
| prompt = "How do you anchor a ship in rough weather?" | |
| outputs = llm.generate([prompt], sampling_params) | |
| print(outputs[0].outputs[0].text) | |
| ``` | |
| ## π Performance | |
| - **Response Speed**: 18-20 tokens/second (vLLM on 2x A100) | |
| - **Load Time**: ~4 minutes (first load from Hugging Face) | |
| - **Memory Usage**: ~65GB per GPU (tensor parallel) | |
| - **Context Length**: 128k tokens (configurable, tested with 120k) | |
| - **Maritime Accuracy**: Specialized knowledge in nautical operations | |
| - **Safety Focus**: Emphasizes safe maritime practices | |
| ## π‘ Example Prompts | |
| ### Navigation Questions | |
| ``` | |
| "What is celestial navigation?" | |
| "How do you plot a course using GPS?" | |
| "Explain magnetic compass deviation and variation" | |
| "What are the principles of dead reckoning?" | |
| ``` | |
| ### Ship Operations | |
| ``` | |
| "What are the steps for anchoring in emergency conditions?" | |
| "How do you perform a man overboard maneuver?" | |
| "What is the proper procedure for docking in strong winds?" | |
| "How do you calculate cargo stability?" | |
| ``` | |
| ### Safety & Regulations | |
| ``` | |
| "What are the COLREGS rules for overtaking?" | |
| "How do you signal distress at sea?" | |
| "What are the requirements for crossing traffic separation schemes?" | |
| "What should you do if you encounter a vessel not under command?" | |
| ``` | |
| ## β οΈ Important Notes | |
| - **Specialized Domain**: This model is optimized for maritime topics and may not perform as well on general tasks | |
| - **Safety Critical**: Always verify navigation and safety information with official sources | |
| - **Professional Use**: Intended for maritime professionals and educational purposes | |
| - **Real-time Operations**: Not a substitute for official navigation equipment or procedures | |
| - **Memory Requirements**: Tested with 120k context on 2x A100 GPUs; reduce `max_model_len` if you have memory constraints | |
| ## π§ Hardware Requirements | |
| ### Minimum Requirements | |
| - **RAM**: 80GB+ system RAM | |
| - **VRAM**: 80GB+ GPU memory (A100 recommended) | |
| - **Storage**: 200GB+ available space | |
| ### Recommended Setup | |
| - **GPUs**: 2x NVIDIA A100 (80GB each) | |
| - **RAM**: 128GB+ system RAM | |
| - **Storage**: NVMe SSD for optimal loading speed | |
| ## π Training Data | |
| This model was fine-tuned on maritime navigation data including: | |
| - Navigation textbooks and manuals | |
| - Maritime regulations and procedures | |
| - Ship handling guides | |
| - Weather routing resources | |
| - Emergency response protocols | |
| ## π€ Contributing | |
| This model is part of the Llamarine project aimed at advancing AI assistance in maritime operations. For questions or contributions, please reach out through the Hugging Face community. | |
| ## π License | |
| This model inherits the Llama 2 license from the base model. Please review the license terms before commercial use. | |
| ## π Fair Winds and Following Seas | |
| *"The sea, once it casts its spell, holds one in its net of wonder forever."* - Jacques Cousteau | |