Downloads · 30 days
12
12% of all-time downloads
Opentrouter-ai/NSW-1
NSW-1 is a machine learning model from Opentrouter-ai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
NSW-1 is a transformer-based causal language model developed by Opentrouter-ai, designed for efficient training and inference on consumer-grade hardware. The model specializes in three core domains: financial analysis…
Downloads · 30 days
12
12% of all-time downloads
All-time downloads
104
Public
Repo size
—
Likes
1
Public
Click a slice to open those files.
.py32.8 KB · 69%
From the Hugging Face model README
NSW-1 is a transformer-based causal language model developed by Opentrouter-ai, designed for efficient training and inference on consumer-grade hardware. The model specializes in three core domains: financial analysis, general-purpose natural language understanding, and content safety classification. With approximately 1.2 billion parameters, NSW-1 is optimized specifically for Intel Core Ultra 7 processors, leveraging Intel Extension for PyTorch to deliver high-performance CPU-based inference.
NSW-1 employs a decoder-only transformer architecture with the following specifications:
The model uses SiLU activation functions, RMSNorm for layer normalization, and rotary position embeddings (RoPE) for improved positional encoding.
Trained on financial documents, market reports, and economic literature, NSW-1 can assist with market analysis, risk assessment, financial summarization, and economic trend interpretation.
The model handles diverse natural language processing tasks including question answering, text generation, summarization, translation, and reasoning across multiple domains.
Built-in content moderation capabilities enable toxicity detection, bias assessment, and content appropriateness evaluation for production applications.
Minimum Configuration:
Recommended Configuration:
Install the required dependencies using pip:
pip install -r requirements.txt
For optimal performance on Intel processors, ensure Intel Extension for PyTorch is properly installed:
pip install intel-extension-for-pytorch
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "Opentrouter-ai/NSW-1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
prompt = "Explain the relationship between inflation and interest rates:"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=200,
temperature=0.7,
top_p=0.9
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
import intel_extension_for_pytorch as ipex
model = AutoModelForCausalLM.from_pretrained(model_name)
model = ipex.optimize(model, dtype=torch.float32)
model.eval()
Deploy the model as a REST API service:
python inference_server.py
The server exposes endpoints at http://localhost:8000:
/generate - General text generation/finance-analysis - Financial domain queries/safety-check - Content safety evaluation/health - Service health statusOrganize your training data in text format:
data/
├── train.txt
└── val.txt
python train.py \
--config config.yaml \
--data_path ./data \
--output_dir ./output \
--epochs 3
Training parameters can be adjusted in config.yaml. Key settings include learning rate, batch size, gradient accumulation steps, and hardware-specific optimizations for Intel processors.
The model is optimized for CPU inference through several mechanisms:
Expected inference speed on Intel Core Ultra 7: 15-25 tokens per second depending on configuration and prompt complexity.
NSW-1 incorporates content filtering and bias mitigation strategies, but users should implement additional safeguards when deploying in production environments. The model should not be used for automated decision-making in high-stakes scenarios without human oversight.
This model is released under the Apache License 2.0. See LICENSE file for full terms.
@misc{nsw1_2024,
author = {Opentrouter-ai},
title = {NSW-1: A General Purpose Language Model},
year = {2024},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/Opentrouter-ai/NSW-1}}
}
For technical issues, feature requests, or questions, please open an issue in the model repository or contact the development team through the HuggingFace model page.