



const { OpenAI } = require('openai');
const api = new OpenAI({
baseURL: 'https://api.ai.cc/v1',
apiKey: '',
});
const main = async () => {
const result = await api.chat.completions.create({
model: 'bigcode/starcoder',
messages: [
{
role: 'system',
content: 'You are an AI assistant who knows everything.',
},
{
role: 'user',
content: 'Tell me, why is the sky blue?'
}
],
});
const message = result.choices[0].message.content;
console.log(`Assistant: ${message}`);
};
main();
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.ai.cc/v1",
api_key="",
)
response = client.chat.completions.create(
model="bigcode/starcoder",
messages=[
{
"role": "system",
"content": "You are an AI assistant who knows everything.",
},
{
"role": "user",
"content": "Tell me, why is the sky blue?"
},
],
)
message = response.choices[0].message.content
print(f"Assistant: {message}")
-
AI Playground

Test all API models in the sandbox environment before you integrate.
We provide more than 300 models to integrate into your app.


Product Detail
The StarCoder (16B) model, developed by the BigCode project, stands as a powerful large language model specifically engineered for code. Released in 2022, this 15.5 billion parameter model (Version 1.0) is a cutting-edge text-based AI designed to significantly enhance developer productivity across a multitude of coding tasks.
⭐ Key Functionality: StarCoder excels in code generation, completion, and infilling, making it an invaluable assistant for modern software development workflows.
🌟 Core Features & Innovations
- 🧠 Multi-Query Attention Architecture: This innovative design allows the model to process and understand multiple queries concurrently. This leads to a superior grasp of coding context and significantly improves the relevance and coherence of generated code.
- 📖 Extensive 8192 Token Context Window: StarCoder's ability to consider a vast amount of prior code and instructions (up to 8192 tokens) ensures that its outputs are highly contextualized, reducing errors and increasing practical utility.
- 🧩 Fill-in-the-Middle (FIM) Objective Training: Trained with a unique objective to fill in missing code segments, StarCoder develops a deeper, more intuitive understanding of code structure and logic, far beyond simple sequential generation.
- 🌐 Broad Programming Language Support: With training across over 80 programming languages, StarCoder is a versatile tool for developers working across diverse technological stacks.
🎯 Intended Use Cases for Developers
StarCoder (16B) is specifically designed to empower developers by automating and assisting in various coding scenarios:
- ✅ Code Snippet Generation: Quickly generate code from natural language descriptions.
- ✅ Code Completion: Intelligent suggestions to finish partially written code.
- ✅ Code Infilling: Fill in missing segments within existing codebases.
- ✅ Refactoring & Optimization: Aid in improving existing code for clarity, efficiency, and maintainability.
💻 StarCoder supports major programming languages like Python, Java, JavaScript, C++, and Go, alongside many others. While its primary training data is English, it processes multilingual natural language prompts effectively.
⚙️ Technical Deep Dive
🏗️ Architecture Insights
Built upon the robust foundations of the GPT-2 architecture, StarCoder incorporates crucial enhancements. The core is its Multi-Query Attention mechanism, which significantly refines its ability to simultaneously process diverse queries, leading to a more nuanced understanding of code. As a transformer-based model, it leverages sequential transformer blocks for efficient input processing and output generation.
📊 Training Data & Scale
StarCoder was trained on The Stack (v1.2) dataset, a colossal collection of source code sourced directly from GitHub. This dataset encompasses code from over 80 programming languages and covers an extensive array of domains, from web development to machine learning. The sheer scale of its training is remarkable, involving an astounding 1 trillion tokens.
🚀 Performance & Benchmarks
The model has demonstrated state-of-the-art performance across several critical benchmarks:
- Human Eval: Outperforms CodeCushman across 12 languages, showcasing its high-quality code generation capabilities.
- DS-1000: Achieves leading results for data science workflows, highlighting its proficiency in complex, domain-specific tasks.
- 💡 Practical Code Generation: Excels in real-world scenarios requiring the integration of external libraries and APIs, affirming its applicability beyond theoretical benchmarks.
⚖️ Ethical Considerations & Licensing
The BigCode project has prioritized data governance and transparency. To this end, an opt-out process was provided for source code developers who preferred their contributions not be included in the training dataset.
StarCoder (16B) is distributed under the BigCode OpenRAIL-M v1 license agreement, which permits both commercial and non-commercial utilization of the model.
❓ Frequently Asked Questions (FAQ)
Q1: What is StarCoder (16B) primarily designed for?
A1: StarCoder (16B) is primarily designed as an AI coding assistant for tasks like code generation, completion, and infilling across various programming languages.
Q2: How many programming languages does StarCoder support?
A2: The model supports over 80 programming languages, including popular ones like Python, Java, JavaScript, C++, and Go.
Q3: What are the key architectural innovations in StarCoder?
A3: Key innovations include its Multi-Query Attention architecture for better contextual understanding and its training with a Fill-in-the-Middle objective for deeper code comprehension.
Q4: What dataset was used to train StarCoder?
A4: StarCoder was trained on The Stack (v1.2) dataset, a massive collection of source code from GitHub, comprising 1 trillion tokens from over 80 programming languages.
Q5: Can StarCoder (16B) be used for commercial projects?
A5: Yes, StarCoder (16B) is licensed under the BigCode OpenRAIL-M v1 agreement, which permits both commercial and non-commercial use.
Learn how you can transformyour company with AICC APIs



Log in