Text Generation
Transformers
Safetensors
English
mangrove
ecology
conservation
function-calling
naturecode
climate
conversational
Instructions to use hilarl/naturecode-mangrove-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hilarl/naturecode-mangrove-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hilarl/naturecode-mangrove-small") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hilarl/naturecode-mangrove-small", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hilarl/naturecode-mangrove-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hilarl/naturecode-mangrove-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hilarl/naturecode-mangrove-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hilarl/naturecode-mangrove-small
- SGLang
How to use hilarl/naturecode-mangrove-small 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 "hilarl/naturecode-mangrove-small" \ --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": "hilarl/naturecode-mangrove-small", "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 "hilarl/naturecode-mangrove-small" \ --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": "hilarl/naturecode-mangrove-small", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hilarl/naturecode-mangrove-small with Docker Model Runner:
docker model run hf.co/hilarl/naturecode-mangrove-small
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="hilarl/naturecode-mangrove-small")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages)# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("hilarl/naturecode-mangrove-small", dtype="auto")Quick Links
Naturecode Mangrove Small
Expert AI model for mangrove ecosystem knowledge with function calling capabilities.
Model Description
Naturecode Mangrove Small is a specialized language model trained on comprehensive mangrove ecosystem data. It combines deep domain knowledge about mangrove ecology, conservation, and climate science with function calling capabilities, making it ideal for building mangrove monitoring and research applications.
Key Features
- Domain Expert: Trained on extensive mangrove ecosystem knowledge
- Function Calling: Can invoke tools for data retrieval and analysis
- Conservation Focus: Understands mangrove importance for climate and biodiversity
- Lightweight: 270M parameters for edge deployment
Usage
General Knowledge
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("google/functiongemma-270m-it")
model = PeftModel.from_pretrained(base_model, "hilarl/naturecode-mangrove-small")
tokenizer = AutoTokenizer.from_pretrained("google/functiongemma-270m-it")
prompt = "<start_of_turn>user\nWhat is a mangrove ecosystem?<end_of_turn>\n<start_of_turn>model\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0]))
Function Calling
prompt = """<start_of_turn>user
[mangrove_api]
{"name": "get_species_info", "description": "Get information about a mangrove species", "parameters": {"species_name": "string"}}
Tell me about Rhizophora mangle<end_of_turn>
<start_of_turn>model
"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
# Output: <start_function_call>call:get_species_info{species_name:<escape>Rhizophora mangle<escape>}<end_function_call>
Knowledge Domains
- Species Information: Mangrove tree species, characteristics, distribution
- Ecosystem Services: Carbon sequestration, coastal protection, biodiversity
- Conservation: Threats, restoration techniques, protected areas
- Climate Science: Blue carbon, sea level rise adaptation
- Monitoring: Remote sensing, field survey methods
Training Details
- Base Model: google/functiongemma-270m-it
- Training Method: Mixed training (40% function calling, 60% general knowledge)
- Training Data: Curated mangrove knowledge base + function calling dataset
Intended Use
- Mangrove research assistants
- Conservation planning tools
- Educational applications about coastal ecosystems
- Mangrove monitoring system integration
- Climate science applications
Limitations
- Focused on mangrove ecosystems; general knowledge is limited
- Function calling requires proper tool descriptions
- Knowledge based on training data cutoff
License
Apache 2.0
Citation
@misc{naturecode-mangrove-small,
author = {Naturecode},
title = {Naturecode Mangrove Small},
year = {2025},
publisher = {HuggingFace},
}
Model tree for hilarl/naturecode-mangrove-small
Base model
google/functiongemma-270m-it
# Gated model: Login with a HF token with gated access permission hf auth login