large language
Mellum2 12B A2.5B Instruct
A post-trained MoE assistant model (64 experts, 8 active/token), mixing sliding-window/full attention, 131,072-token context.
Model details
View repositoryExample usage
Input
1# You can use this model with any of the OpenAI clients in any language!
2# Simply change the API Key to get started
3from openai import OpenAI
4
5model_url = "" # Copy in from API pane in Baseten model dashboard
6
7client = OpenAI(
8 api_key = "BASETEN_API_KEY",
9 base_url = model_url
10)
11
12response = client.chat.completions.create(
13 model = "JetBrains/Mellum2-12B-A2.5B-Instruct",
14 messages = [{"role":"user","content":"Write a Python function to reverse a string."}],
15)
16
17print(response.to_json())JSON output
1{
2 "choices": [
3 {
4 "finish_reason": "stop",
5 "index": 0,
6 "logprobs": null,
7 "message": {
8 "content": "To reverse a string in Python, we can utilize string slicing with a step of -1. This approach efficiently creates a new string with characters in reverse order.\n\n```python\ndef reverse_string(s):\n return s[::-1]\n```\n\n**Explanation:**\n- The slice `[::-1]` starts at the end of the string and moves backwards, effectively reversing the string.\n- This method works for any string input, including empty strings and single-character strings.\n- The original string remains unchanged, as strings in Python are immutable.\n\n**Example Usage:**\n```python\nprint(reverse_string(\"hello\")) # Output: \"olleh\"\nprint(reverse_string(\"Python\")) # Output: \"nohtyP\"\nprint(reverse_string(\"\")) # Output: \"\"\n```",
9 "refusal": null,
10 "role": "assistant",
11 "annotations": null,
12 "audio": null,
13 "function_call": null,
14 "tool_calls": [],
15 "reasoning": null
16 },
17 "stop_reason": null,
18 "token_ids": null,
19 "routed_experts": null
20 }
21 ],
22 "created": 0,
23 "model": "JetBrains/Mellum2-12B-A2.5B-Instruct",
24 "object": "chat.completion",
25 "usage": {
26 "completion_tokens": 179,
27 "prompt_tokens": 19,
28 "total_tokens": 198,
29 "prompt_tokens_details": null
30 },
31 "prompt_logprobs": null,
32 "prompt_token_ids": null,
33 "prompt_text": null,
34 "kv_transfer_params": null
35}