--- license: agpl-3.0 datasets: - lumolabs-ai/Lumo-Iris-DS-Instruct language: - en base_model: - deepseek-ai/DeepSeek-R1-Distill-Llama-8B --- # 🧠 Lumo-DeepSeek-R1-8B Model  [](https://www.gnu.org/licenses/agpl-3.0.html) [](https://huggingface.co/lumolabs-ai/Lumo-DeepSeek-R1-8B) ## **Overview** The **Lumo-DeepSeek-R1-8B** model is a fine-tuned version of DeepSeek-R1-Distill-Llama-8B, specifically optimized for Solana and its associated ecosystems. This model is designed to provide highly accurate and contextual assistance for developers, offering capabilities such as answering complex questions, generating code snippets, debugging, and explaining technical concepts. The fine-tuning process leverages the **Lumo-Iris-DS-Instruct** dataset, ensuring the model is well-suited for Solana-specific tasks. **(Knowledge cut-off date: 17th January, 2025)** ### 🎯 **Key Features** - Optimized for **Solana-specific queries** across ecosystems like Raydium, Helius, Jito, and more. - Instruction fine-tuned for **developer-centric workflows**. - Lightweight parameter-efficient fine-tuning via **LoRA (Low-Rank Adaptation)**. - **Supports multi-turn conversations** with context retention. - Outputs complete code snippets and **real-world usage examples**. --- ## 🚀 **Model Card** | **Parameter** | **Details** | |----------------------------|----------------------------------------------------------------------------------------------| | **Base Model** | DeepSeek-R1-Distill-Llama-8B | | **Fine-Tuning Framework** | HuggingFace Transformers, LoRA | | **Dataset Size** | 28,518 high-quality Q&A pairs | | **Context Length** | 128,000 tokens | | **Training Steps** | 10,000 | | **Learning Rate** | 3e-4 | | **Batch Size** | 1 per GPU with gradient accumulation | | **Epochs** | 2 | | **Model Size** | 8 billion parameters (adapter size ~10 MB) | | **Pre-trained Tasks** | Instruction following, Code generation, Debugging, Multi-turn Q&A | --- ## 📊 **Model Architecture** ### **Training Workflow** The model was fine-tuned using parameter-efficient methods with **LoRA** to adapt to the Solana-specific domain. Below is a visualization of the training process:  ### **Dataset Sources** The dataset comprises curated documentation, cookbooks, and API references from the following sources: | Source | Links | |--------------------|--------------------------------------------------------------------------------| | **Lumo-Iris-DS-Instruct** | [About Lumo-Iris](https://www.lumolabs.ai/lumo-dataset/about-lumo-iris) | --- ## 🛠️ **Installation and Usage** ### **1. Installation** ```bash pip install transformers datasets peft wandb ``` ### **2. Load the Model** ```python from transformers import LlamaForCausalLM, AutoTokenizer model_name = "lumolabs-ai/Lumo-DeepSeek-R1-8B" model = LlamaForCausalLM.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name) ``` ### **3. Run Inference** ```python def complete_chat(model, tokenizer, messages, max_new_tokens=128): inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True, add_generation_prompt=True).to(model.device) with torch.no_grad(): outputs = model.generate(**inputs, max_new_tokens=max_new_tokens) return tokenizer.decode(outputs[0], skip_special_tokens=True) response = complete_chat(model, tokenizer, [ {"role": "system", "content": "You are Lumo, a helpful assistant."}, {"role": "user", "content": "Explain how to interact with Raydium API for token swaps."} ]) print(response) ``` --- ## 📈 **Performance** | **Metric** | **Value** | |---------------------|-----------------------| | **Validation Loss** | 1.73 | | **BLEU Score** | 89% | | **Code Accuracy** | 92% | | **Token Efficiency**| ~128,000 tokens max | ### **Fine-Tuning Loss Graph**  --- ## 📂 **Dataset** | Split | Count | Description | |---------|--------|--------------------------------| | **Train** | 27.1k | High-quality Q&A pairs | | **Test** | 1.43k | Evaluation dataset for testing| **Dataset Format (JSONL):** ```json { "question": "How to use the Helius API for transaction indexing?", "answer": "To index transactions, use Helius's Webhooks API ...", "chunk": "Helius API allows you to set up ..." } ``` --- ## 🔍 **Technical Insights** ### **LoRA Configuration** - Rank: 8 - Alpha: 32 - Dropout: 0.01 - Adapter Size: ~10 MB ### **Optimization** - Mixed Precision (FP16) for faster inference. - Gradient Accumulation for memory efficiency. - Parameter-efficient tuning to preserve base model knowledge. --- ## 🌟 **Try the model** 🚀 [Lumo-DeepSeek-R1-8B Inferencing](http://try-deepseek-lumo8b.lumolabs.ai) --- ## 📊 **Performance Comparison** ### **DeepSeek-R1-Evaluation**