Sema LLM — twi-qwen-v1
A Twi / English / Nigerian Pidgin code-switching conversational model, fine-tuned from a Qwen3.5 hybrid-attention base. Built by Sema Ink as Ama, a bilingual Ghanaian assistant.
Overview
- Languages: Akan/Twi (
tw), English (en), Nigerian Pidgin (pcm) — including natural intra-sentence code-switching. - Task: instruction-following chat / conversation.
- Base architecture: Qwen3.5 (
Qwen3_5ForCausalLM) — a gated hybrid-attention transformer: 32 layers with full attention every 4th layer (8 full-attention + 24 linear-attention), hidden size 4096, vocabulary 248,320, context length up to 262,144 tokens, bf16. ~9B parameters. - Reasoning: supports an optional thinking mode via the chat template (
enable_thinking). Default usage keeps it off for clean, direct answers; set itTrueto expose the reasoning trace.
Usage (transformers)
Requires a
transformersbuild with Qwen3.5 support (install from source) andtrust_remote_code=True.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "travis-moore/twi-qwen-v1-merged"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
)
messages = [
{"role": "system", "content": "You are Ama, a helpful bilingual Twi-English assistant."},
{"role": "user", "content": "Maakye! Wo ho te sɛn?"},
]
text = tok.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)
ids = tok(text, return_tensors="pt").to(model.device)
out = model.generate(
**ids, max_new_tokens=384, do_sample=True,
temperature=0.7, top_p=0.9, repetition_penalty=1.2,
)
print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))
Usage (vLLM)
The Qwen3.5 GDN-hybrid architecture needs a recent vLLM (e.g. the vllm/vllm-openai:latest image). It then serves an OpenAI-compatible /v1/chat/completions endpoint. Pass chat_template_kwargs={"enable_thinking": false} to suppress the reasoning trace.
Intended use
Conversational assistants, chatbots, and assistive tools for Ghanaian and West-African users who mix Twi, English, and Pidgin. Research and product use.
Limitations
- Twi and Pidgin are low-resource; expect errors on dense or rare Twi, named entities, numbers, and long-tail facts.
- This is an early version (v1); it has not been safety-tuned or red-teamed — validate outputs before relying on them.
- Not evaluated against external benchmarks here; treat quality claims as anecdotal.
License
Released under Apache-2.0, inherited from the Qwen3-series base model.
Developed by
Sema Ink — Twi / Ghanaian-language AI (speech recognition, text-to-speech, and chat).