Models
Code Models
Expert code generation, debugging, and refactoring
Code Models
Generate, debug, and refactor code with Assisters Code, our specialized model for software development tasks.
Assisters Code v1
Model IDstringassisters-code-v1
Our advanced code model optimized for programming tasks across multiple languages with deep understanding of software engineering principles.
| Specification | Value |
|---|---|
| Model ID | assisters-code-v1 |
| Context Window | 128,000 tokens |
| Max Output | 8,192 tokens |
| Input Price | $0.10 / million tokens |
| Output Price | $0.20 / million tokens |
| Latency | ~200ms first token |
Capabilities
- Code Generation: Write code from natural language descriptions
- Debugging: Identify and fix bugs in existing code
- Refactoring: Improve code quality and performance
- Code Review: Analyze code for issues and best practices
- Documentation: Generate docstrings and comments
- Multi-language: Support for 50+ programming languages
Supported Languages
Python, JavaScript, TypeScript, Java, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Scala, R, MATLAB, SQL, HTML, CSS, Shell/Bash, and many more.
Example Usage
from openai import OpenAI
client = OpenAI(
base_url="https://api.assisters.dev/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="assisters-code-v1",
messages=[
{"role": "system", "content": "You are an expert software engineer."},
{"role": "user", "content": "Write a Python function to find the nth Fibonacci number using memoization"}
]
)
print(response.choices[0].message.content)Code Debugging
buggy_code = """
def binary_search(arr, target):
left = 0
right = len(arr)
while left < right:
mid = (left + right) / 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid
else:
right = mid
return -1
"""
response = client.chat.completions.create(
model="assisters-code-v1",
messages=[
{"role": "system", "content": "You are a debugging expert."},
{"role": "user", "content": f"Find and fix the bugs in this code:\n\n{buggy_code}"}
]
)Code Review
response = client.chat.completions.create(
model="assisters-code-v1",
messages=[
{"role": "system", "content": "You are a senior code reviewer. Provide constructive feedback."},
{"role": "user", "content": f"Review this code for best practices, performance, and security:\n\n{code_to_review}"}
]
)Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
messages | array | required | Conversation history |
temperature | float | 0.2 | Randomness (lower for code) |
max_tokens | int | 2048 | Maximum output length |
stream | bool | false | Enable streaming |
stop | array | null | Stop sequences |
Use Cases
Best Practices
Use Low Temperature
Set temperature to 0.1-0.3 for more deterministic code output
Provide Context
Include relevant code context for better understanding
Specify Language
Clearly state the programming language you want
Review Output
Always review and test generated code before use
Tips for Better Results
- Be specific: "Write a function that..." is better than "Help me with..."
- Include requirements: Mention edge cases, error handling, and performance needs
- Provide examples: Show input/output examples when possible
- Iterate: Use follow-up messages to refine the code