File size: 5,412 Bytes
ee7c8d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
---
license: llama2
base_model: meta-llama/Llama-3.1-70B-Instruct
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-Instruct model with maritime-specific LoRA adapters.

## 🚒 Model Details

- **Base Model**: meta-llama/Llama-3.1-70B-Instruct
- **Specialization**: Maritime navigation, seamanship, and nautical operations
- **Model Type**: Merged (base + LoRA adapters)
- **Model Size**: ~140B parameters
- **Precision**: bfloat16
- **Context Length**: 2048 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("nguyennm1024/llamarine")
model = AutoModelForCausalLM.from_pretrained(
    "nguyennm1024/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="nguyennm1024/llamarine",
    tensor_parallel_size=2,  # Adjust based on your GPU setup
    dtype="bfloat16"
)

# Configure sampling
sampling_params = SamplingParams(
    temperature=0.7,
    top_p=0.9,
    max_tokens=200
)

# 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**: 15-20 tokens/second (vLLM on 2x A100)
- **Context Awareness**: Maintains conversation history
- **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

## πŸ”§ 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