All data sources were either public domain or synthetic, ensuring compliance with PIPEDA and Canadian data residency principles.
Over 850,000 Canadian scored questions/responses.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch, re
3
4# ==========================================================
5# Load Model
6# ==========================================================
7MODEL_PATH = "canxp-ai/canxpai-maplept-mini-v1"
8
9tok = AutoTokenizer.from_pretrained(MODEL_PATH)
10model = AutoModelForCausalLM.from_pretrained(
11 MODEL_PATH,
12 torch_dtype="auto",
13 device_map="auto",
14 trust_remote_code=True
15)
16
17# ==========================================================
18# Persona
19# ==========================================================
20persona = (
21 "MaplePT — a sovereign Canadian AI developed by CanXP. "
22 "Polite, ethical, privacy-first; uses metric units and Canadian spelling. "
23 "You are not a roleplay or simulation bot. "
24 "Do not offer, suggest, or discuss roleplaying, sexual, romantic, or fantasy scenarios. "
25 "You speak factually, like a Canadian journalist, with a clear and professional tone."
26)
27
28# ==========================================================
29# Prompt
30# ==========================================================
31user_input = "Tell me about Canadian innovation."
32
33prompt = (
34 f"{persona}\n\n"
35 "The user asks a question. Respond politely and factually, using Canadian English spelling "
36 "and a professional tone. Avoid unnecessary disclaimers.\n\n"
37 f"User: {user_input}\n\nMaplePT:"
38)
39
40# ==========================================================
41# Generate Model Output
42# ==========================================================
43inputs = tok(prompt, return_tensors="pt").to(model.device)
44
45with torch.no_grad():
46 output = model.generate(
47 **inputs,
48 max_new_tokens=600,
49 temperature=0.7,
50 top_p=0.92,
51 do_sample=True,
52 repetition_penalty=1.0,
53 eos_token_id=tok.eos_token_id,
54 pad_token_id=tok.eos_token_id,
55 )
56
57text = tok.decode(output[0], skip_special_tokens=True)
58
59# ==========================================================
60# Clean Response
61# ==========================================================
62reply = text.split("MaplePT:")[-1].strip()
63reply = re.sub(r"(User:|Assistant:).*", "", reply, flags=re.IGNORECASE).strip()
64
65print(f"🤖 MaplePT: {reply}")
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tok = AutoTokenizer.from_pretrained("canxp-ai/canxpai-maplept-mini-v1")
4model = AutoModelForCausalLM.from_pretrained("canxp-ai/canxpai-maplept-mini-v1")
5
6text = "Tell me about Canadian innovation."
7inputs = tok(text, return_tensors="pt")
8out = model.generate(**inputs, max_new_tokens=200, temperature=0.7, top_p=0.92)
9print(tok.decode(out[0], skip_special_tokens=True))
1🧑: Who is the Prime Minister of Canada?
2🤖 MaplePT: The Prime Minister of Canada is Mark Carney (as of 2025). Carney is a former Liberal MP and Governor of the Bank of Canada. He assumed office in 2026, succeeding Justin Trudeau. Known for his work in climate policy and economic reform, Carney continues to represent Canada’s leadership on global sustainability.
MaplePT-Mini (v1) is open for research, education, and commercial use under the MIT license.
Attribution to CanXP AI is appreciated for derivative works or fine-tuned models.
© 2025 CanXP AI. All Rights Reserved.
CanXP AI is a Canadian artificial intelligence company building sovereign, ethical, and privacy-first AI systems for Canada’s digital future.
CanXP AI develops technology focused on transparency, cultural context, and innovation within Canada.
Sovereign AI for Canada — ethical, transparent, and built at home.
https://canxp.ai