Introduction of Fyodor-StarCoder2-7B-Instruct-Agentic
Model Details of Fyodor-StarCoder2-7B-Instruct-Agentic
Fyodor-StarCoder2-7B-MoE
A Mixture-of-Experts (MoE) enhanced version of StarCoder2-7B with 8 experts and top-2 routing.
Model Description
This model extends
StarCoder2-7B
with a custom Mixture-of-Experts architecture, adding 8 expert networks with top-2 routing. The MoE layers are strategically placed throughout the model to enhance performance on code generation and function calling tasks.
Key Features
🎯
8 Expert Networks
: Specialized sub-networks for different coding patterns
🔀
Top-2 Routing
: Dynamic expert selection with load balancing
💡
Enhanced Code Understanding
: Trained on diverse coding and instruction datasets
🚀
Efficient Architecture
: Only MoE layers and LM head trained, base model frozen
🎓
Function Calling
: Strong capabilities in structured function calling and API usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("Kiy-K/Fyodor-StarCoder2-7B-Instruct-Agentic")
# Load model
model = AutoModelForCausalLM.from_pretrained(
"your-username/fyodor-starcoder2-7b-moe",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
ignore_mismatched_sizes=True
)
Code Generation Example
prompt = """### Instruction:Write a Python function that calculates the factorial of a number recursively.### Response:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
top_p=0.95,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Function Calling Example
prompt = """### Instruction:Generate a function call to search for restaurants near a location.Available functions:- search_restaurants(location: str, cuisine: str, price_range: str)### Response:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
Hyperparameters
Batch Size
: 16
Gradient Accumulation Steps
: 16
Effective Batch Size
: 256
Learning Rate
: 5e-5
Epochs
: 3
Warmup Steps
: 100
Max Sequence Length
: 384
Optimizer
: AdamW (weight_decay=0.01)
Scheduler
: Linear with warmup
Mixed Precision
: BFloat16
Hardware
GPU
: NVIDIA A100 (recommended) or equivalent
Memory
: ~40GB VRAM with 4-bit quantization
Training Time
: ~8-12 hours (depends on hardware)
Evaluation
The model shows strong performance on:
✅ Python code generation
✅ Function calling and API usage
✅ Code explanation and documentation
✅ Multi-turn coding conversations
✅ Instruction following
Limitations
Base model knowledge cutoff applies (training data up to 2023)
May occasionally generate incorrect or suboptimal code
Best performance on Python; other languages may vary
Requires proper prompt formatting for optimal results
Ethical Considerations
This model can generate code that may have security implications
Users should review and test all generated code before deployment
The model inherits biases from training data
Not suitable for safety-critical applications without human oversight
Citation
If you use this model, please cite:
@misc{fyodor-starcoder2-moe,
author = {Khoi},
title = {Fyodor-StarCoder2-7B-MoE: A Mixture-of-Frozen-Experts Code Model},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/Kiy-K/Fyodor-StarCoder2-7B-Instruct-Agentic}}
}
Also cite the base model:
@misc{lozhkov2024starcoder2,
title={StarCoder 2 and The Stack v2: The Next Generation},
author={Lozhkov, Anton and others},
year={2024},
eprint={2402.19173},
archivePrefix={arXiv}
}
License
This model inherits the BigCode OpenRAIL-M license from StarCoder2-7B.
Fyodor-StarCoder2-7B-Instruct-Agentic huggingface.co is an AI model on huggingface.co that provides Fyodor-StarCoder2-7B-Instruct-Agentic's model effect (), which can be used instantly with this Kiy-K Fyodor-StarCoder2-7B-Instruct-Agentic model. huggingface.co supports a free trial of the Fyodor-StarCoder2-7B-Instruct-Agentic model, and also provides paid use of the Fyodor-StarCoder2-7B-Instruct-Agentic. Support call Fyodor-StarCoder2-7B-Instruct-Agentic model through api, including Node.js, Python, http.
Fyodor-StarCoder2-7B-Instruct-Agentic huggingface.co is an online trial and call api platform, which integrates Fyodor-StarCoder2-7B-Instruct-Agentic's modeling effects, including api services, and provides a free online trial of Fyodor-StarCoder2-7B-Instruct-Agentic, you can try Fyodor-StarCoder2-7B-Instruct-Agentic online for free by clicking the link below.
Kiy-K Fyodor-StarCoder2-7B-Instruct-Agentic online free url in huggingface.co:
Fyodor-StarCoder2-7B-Instruct-Agentic is an open source model from GitHub that offers a free installation service, and any user can find Fyodor-StarCoder2-7B-Instruct-Agentic on GitHub to install. At the same time, huggingface.co provides the effect of Fyodor-StarCoder2-7B-Instruct-Agentic install, users can directly use Fyodor-StarCoder2-7B-Instruct-Agentic installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Fyodor-StarCoder2-7B-Instruct-Agentic install url in huggingface.co: