Instructions to use pfnet/plamo-3-8b-fin-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pfnet/plamo-3-8b-fin-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pfnet/plamo-3-8b-fin-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("pfnet/plamo-3-8b-fin-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pfnet/plamo-3-8b-fin-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pfnet/plamo-3-8b-fin-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pfnet/plamo-3-8b-fin-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/pfnet/plamo-3-8b-fin-instruct
- SGLang
How to use pfnet/plamo-3-8b-fin-instruct 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 "pfnet/plamo-3-8b-fin-instruct" \ --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": "pfnet/plamo-3-8b-fin-instruct", "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 "pfnet/plamo-3-8b-fin-instruct" \ --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": "pfnet/plamo-3-8b-fin-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use pfnet/plamo-3-8b-fin-instruct with Docker Model Runner:
docker model run hf.co/pfnet/plamo-3-8b-fin-instruct
PLaMo-3-8B-Fin-Instruct
Model Description
PLaMo-3-8B-Fin-Instruct is a Japanese language model for the financial domain, developed by Preferred Networks, Inc. It is fine-tuned from a PLaMo-3 base model through continued pre-training on financial corpora followed by supervised fine-tuning and direct preference optimization. This is an instruction-tuned model for the financial domain. The model follows the PLaMo-3 chat format.
The model is provided as a chat model that reasons in Japanese: it first writes its thought process in Japanese and then gives the answer. It also supports function calling (tool use). Part of the training was carried out on MN-Core 2, a deep learning accelerator developed by Preferred Networks.
Usage
Requirements
The model has been tested with the following versions:
python==3.12
numpy==2.5.4
numba==0.68.0
torch==2.9.0
transformers==5.20.2
accelerate==1.15.0
Direct loading
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "pfnet/plamo-3-8b-fin-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name, trust_remote_code=True, dtype=torch.bfloat16, device_map="auto"
)
messages = [
{"role": "user", "content": "PERใจใฏไฝใงใใ?ไธๆใง็ญใใฆใ"},
]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Reasoning
The model writes its reasoning in Japanese before answering. The response contains a reasoning block
delimited by <|plamo:begin_think:plamo|> and <|plamo:end_think:plamo|>, followed by the answer,
terminated by <|plamo:tag|>. When showing responses to end users, separate the reasoning block from
the answer.
Function calling
Pass OpenAI-style function definitions to the chat template with the tools argument. When the model
decides to call a tool, it writes the call after its reasoning instead of an answer. Evaluate how
accurately it works with your own tools and tasks before use.
tools = [
{
"type": "function",
"function": {
"name": "get_stock_price",
"description": "้ๆใณใผใใๆๅฎใใฆใ็พๅจใฎๆ ชไพกใ่ฟใใพใใ",
"parameters": {
"type": "object",
"properties": {"code": {"type": "string", "description": "4ๆกใฎ้ๆใณใผใ"}},
"required": ["code"],
},
},
},
]
messages = [{"role": "user", "content": "ใใจใฟ่ชๅ่ป(7203)ใฎไปใฎๆ ชไพกใๆใใฆใ"}]
inputs = tokenizer.apply_chat_template(
messages, tools=tools, add_generation_prompt=True, return_dict=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
A tool call is written in the following format, with the arguments as a JSON object:
<|plamo:begin_tool_requests:plamo|><|plamo:begin_tool_request:plamo|><|plamo:begin_tool_name:plamo|>get_stock_price<|plamo:end_tool_name:plamo|><|plamo:begin_tool_arguments:plamo|><|plamo:constrain|>json<|plamo:msg|>{"code": "7203"}<|plamo:end_tool_arguments:plamo|><|plamo:end_tool_request:plamo|><|plamo:end_tool_requests:plamo|>
Execute the call in your application, append the assistant turn (with tool_calls) and the result
(a message with role tool) to messages, and generate again. Pass tools on every turn: the chat
template renders the tool calls in the history only when tools is given.
Model Details
- Developed by: Preferred Networks, Inc.
- Model type: Causal decoder-only
- Context length: 262,144 tokens (the base model's maximum; continued pre-training on financial corpora used sequences of up to 32,768 tokens)
- Language(s): Japanese
- Tensor type: BF16
- License: PLaMo community license
Tokenizer
The tokenizer is the PLaMo-3 tokenizer, distributed with this repository as
tokenizer.jsonl and tokenization_plamo.py.
Bias, Risks, and Limitations
PLaMo-3-8B-Fin-Instruct is a new technology that carries risks with use. Testing conducted to date has been in Japanese, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, PLaMo-3-8B-Fin-Instruct's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of PLaMo-3-8B-Fin-Instruct, developers should perform safety testing and tuning tailored to their specific applications of the model.
Domain specialization
This model has been additionally trained on financial-domain data and is intended for financial use cases. It is not a general-purpose assistant. If you intend to use it outside the financial domain, evaluate it on your own task first.
Model size and hallucination
With 8B parameters, this model holds less factual knowledge than larger models and is more prone to hallucination: fluent, confident text that is factually wrong. Verify factual and numerical claims against an authoritative source before acting on them, and keep a human reviewer in the loop for consequential decisions.
Function calling
How accurately function calling works depends on your tools and tasks. Evaluate it on your own use case before deploying it. Validate every tool call against your schema before executing it, and require human confirmation before any action with real-world effects, such as placing orders or transferring funds.
Harmful content
Safety alignment is not fully reliable, and the model may generate harmful content, including offensive or violent expressions. Developers should apply content filtering appropriate to their deployment.
Not professional advice
The outputs of this model do not constitute legal, financial, tax, or investment advice, and must not be presented to end users as such. Applications built on this model should not be used to make investment decisions on a user's behalf.
License
PLaMo-3-8B-Fin-Instruct is released under the PLaMo Community License.
- (EN) https://plamo.preferredai.jp/info/plamo-community-license-en
- (JA) https://plamo.preferredai.jp/info/plamo-community-license-ja
Please review the PLaMo Community License and contact us via this form for commercial use: https://forms.gle/mTL8tBLrMYXKNZD56
Contributors
Preferred Networks, Inc.
- Ryo Wakai
- Ryota Ozaki
- Kentaro Imajo
- Masanori Hirano
- Lihang Hong
- Yoshiki Sato
AI policies for Preferred Networks, Inc. group
- Downloads last month
- -
Model tree for pfnet/plamo-3-8b-fin-instruct
Base model
pfnet/plamo-3-nict-8b-base