{"Code":200,"Data":{"AigcAttributes":"{}","AigcIsTop":0,"AigcType":"","AlreadyStar":false,"ApplyMeta":"{}","ApprovalMode":1,"ApprovalNotifyEmail":"","Architectures":["InternS2PreviewForConditionalGeneration"],"Avatar":"https://img.alicdn.com/imgextra/i1/O1CN01yhHrHg1Pdl3UKPhGc_!!6000000001864-2-tps-88-88.png","Backbone":[],"BackendSupport":{"architectures":null,"backend_info":{"deploy_task":null,"lmdeploy":null,"lmdeploy_turbomind":null,"ollama":null,"sglang":null,"vllm":null},"model_id":"Shanghai_AI_Laboratory/Intern-S2-Preview"},"BaseModel":[],"BaseModelRelation":"","CardReady":0,"CardUnreadyReason":"","CertificationCreateBy":"","CertificationCreatedTime":-62135596800,"ChineseName":"","CoverHeight":0,"CoverImages":[],"CoverWidth":0,"CreatedBy":"InternLMadmin","CreatedTime":1778817378,"DashSdkParameter":"","Datasets":{},"DemoAvailable":0,"DemoUnavailableReason":"","Description":"","Domain":[],"Downloads":725,"ExampleCodeAvailable":0,"ExampleCodeUnavailableReason":"","ForbiddenVisibilityUpdate":false,"Frameworks":[],"FromSite":"maas","Id":1466019,"Integrating":0,"IntegrationFailureLog":"","IntegrationFailureReason":"","IsAccessible":1,"IsCertification":4,"IsHot":0,"IsNewModel":false,"IsOnline":1,"IsOrgClaimed":false,"IsPreTrain":0,"IsPublished":1,"IsTop":0,"Language":[],"LastUpdatedTime":1780086523,"Libraries":["safetensors"],"License":"apache-2.0","LicenseLink":"","LicenseName":"","Meta":"","Metrics":[],"ModelDetail":{},"ModelInfos":{"safetensor":{"chat_template":"","files":[{"name":"model.safetensors.index.json","sha256":"dca0c926deca75095f377bc54fb1c88e8775252fd3767d6c8dda25d7c4194ac1","size":194086},{"name":"model-00001-of-00023.safetensors","sha256":"995a45fa3692bd35364745a7b96acdaa631a6c3ffb8a4102edfcbf39229ac5af","size":3920272400},{"name":"model-00002-of-00023.safetensors","sha256":"0c629deac2d23507b1b324096a42f61129f815f2e52621f82e5365fe585580fa","size":3357898400},{"name":"model-00003-of-00023.safetensors","sha256":"063764d67002b7e6bb21c0937dbe4ed90a0355cab570c878a33411ded935bea6","size":3370808760},{"name":"model-00004-of-00023.safetensors","sha256":"50dd6754c2c07aa914817ead2ec53699d8f8b9f1405665d814566281c1951043","size":3357898400},{"name":"model-00005-of-00023.safetensors","sha256":"e7bcd4ca7a6eb1c349170c00858a52e526268b0b305590124e20543750ba1669","size":3370808760},{"name":"model-00006-of-00023.safetensors","sha256":"a6b0c9c45273dac6f35d61ddf45f4b27a5e81203adda07d677f53680f46c89c3","size":3357898360},{"name":"model-00007-of-00023.safetensors","sha256":"9aa57c51a4742dc646e060a9047b8daf12911f69dd4cc7ff98dfb1d32912a24f","size":3370808792},{"name":"model-00008-of-00023.safetensors","sha256":"37c11f3eb529963a1a9c7511a4aeddb45d6182363a42f9dd6b144e0c3f9114b6","size":3357898432},{"name":"model-00009-of-00023.safetensors","sha256":"78728fb1a8ca22a82f6f293cd3bda71e712cd17dd5b55ad8746d7e317aacafa4","size":3370808792},{"name":"model-00010-of-00023.safetensors","sha256":"455404e35f8e0c488eb08196fe27568a13f9f4b36268039d8f37572149a500ef","size":3357898432},{"name":"model-00011-of-00023.safetensors","sha256":"ef470a402662cf45b36d8b12e7dcea6192ff9de7612bd60829410e40e9a4084e","size":3370808792},{"name":"model-00012-of-00023.safetensors","sha256":"9490b4f09f2420deeb254209fa68cdc9339860560d26037ef3b56bc1733b39eb","size":3357898432},{"name":"model-00013-of-00023.safetensors","sha256":"ccb516812b38f42c775f7b6681496129d49f88f3d6874d7ff101580fe0073ab2","size":3370808792},{"name":"model-00014-of-00023.safetensors","sha256":"779b5ee835558166adb60e1e187bf44c1a862b693f94a4a4fec2d59a463be0d9","size":3357898432},{"name":"model-00015-of-00023.safetensors","sha256":"18575d53b0c3708ffbbb14a2e9008a1fa0ec426887ab547ba765e3325436dbdd","size":3370808792},{"name":"model-00016-of-00023.safetensors","sha256":"0e24ce8453b89b8fb6a390358080250d6a6dd60b3190984d7ac9e920711ae33c","size":3357898432},{"name":"model-00017-of-00023.safetensors","sha256":"e8020324419f3ad5f03812594d6ee152c5a869c71077230649321aaf5a76bd9b","size":3370808792},{"name":"model-00018-of-00023.safetensors","sha256":"6f3f9808fd16522e225e30bf1654c366de9827dd9261cbf5bf2bdf6a5b944232","size":3357898432},{"name":"model-00019-of-00023.safetensors","sha256":"64ca6cea07284e2d43ec4fb32e78941b9e505178d3e870891449bf0b73e2f281","size":3370808792},{"name":"model-00020-of-00023.safetensors","sha256":"bd30d6f3db1c81b3ce74e994aa0604781218d8f307203130d768d967428f5b5b","size":3357898432},{"name":"model-00021-of-00023.safetensors","sha256":"b725bd593e946e8242f9e8585f4f7b53c4f6ba1795244f45b9a0ca458714b232","size":4288914488},{"name":"model-00022-of-00023.safetensors","sha256":"b609eeea1d0fcbdd1a5fd9d2979f5c4b331caa4fef49432c096795db90ae1ddd","size":833287792},{"name":"model-00023-of-00023.safetensors","sha256":"ba1b2ece7654c0af7d58eccf467b5fc2f4d5627a047731935a64727bf6e421c9","size":272854528}],"model_size":36098254656,"tensor_type":["BF16","F32"]}},"ModelRevisions":null,"ModelSource":"USER_UPLOAD","ModelTools":"","ModelType":["intern_s2_preview"],"MuseInfo":null,"NEXA":{"Catalogues":[{"Business":"nexa","CatalogID":"comprehensive","ChineseName":"通用学科","ID":37,"Name":"Comprehensive","Parent":0,"Weight":500}],"ModelCover":"","ScientificField":"comprehensive","Source":"nexa","SubScientificField":[]},"Name":"Intern-S2-Preview","NewVersion":"","NickName":"","OfficialTags":null,"OpenAiSwingDeployInfo":{"Order":0,"Recommend":null,"lmdeploy":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"ollama":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"pipeline":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"vllm":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""}},"Organization":{"ApplyFailureReason":"","ApplyReason":"","Avatar":"https://resouces.modelscope.cn/avatar/8ac4e476-b2d6-4bbd-89d5-bb826c0d3e5f.webp","CreateCompetition":false,"CreatedBy":"Cherrytest","Description":"[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"上海人工智能实验室是人工智能领域的新型科研机构，开展战略性、原创性、前瞻性的科学研究与技术攻关，突破人工智能的重要基础理论和关键核心技术，打造“突破型、引领型、平台型”一体化的大型综合性研究基地，支撑人工智能产业实现跨越式发展。\"]]]]","DisplayUrl":"","Email":"","EmailDomain":"","FollowerCnt":0,"FromSite":"","FullName":"上海人工智能实验室","GithubAddress":"https://www.shlab.org.cn/","GmtCreated":"2023-08-29T03:51:49Z","GmtModified":"2026-10-20T07:41:48Z","Id":325,"InitAdminMembers":"","IsApply":false,"IsCertification":"","MemberCnt":0,"Mobile":"","Name":"Shanghai_AI_Laboratory","Path":"","Roles":null,"SocialLinks":null,"StarCnt":0,"Status":0,"SubscribeVo":null,"Type":1},"PaiModelGalleryUrl":null,"PaiSdkParameter":null,"Path":"Shanghai_AI_Laboratory","ProtectedMode":2,"ReadMeContent":"\n## Intern-S2-Preview\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./figs/title.png\" /\u003e\n\n  \u003cdiv\u003e\u0026nbsp;\u003c/div\u003e\n\n[💻Github Repo](https://github.com/InternLM/Intern-S1) • [🤗Model Collections](https://huggingface.co/collections/internlm/intern-s2) • [💬Online Chat](https://chat.intern-ai.org.cn/)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    👋 join us on \u003ca href=\"https://discord.gg/xa29JuW87d\" target=\"_blank\"\u003eDiscord\u003c/a\u003e and \u003ca href=\"https://cdn.vansin.top/intern-s1.jpg\" target=\"_blank\"\u003eWeChat\u003c/a\u003e\n\u003c/p\u003e\n\n\n\n## Introduction\n\nWe introduce **Intern-S2-Preview**, an efficient 35B scientific multimodal foundation model. Beyond conventional parameter and data scaling, Intern-S2-Preview explores **task scaling**: increasing the difficulty, diversity, and coverage of scientific tasks to further unlock model capabilities. \n\nBy extending professional scientific tasks into a full-chain training pipeline from pre-training to reinforcement learning, Intern-S2-Preview achieves performance comparable to the trillion-scale Intern-S1-Pro on multiple core professional scientific tasks, while using only 35B parameters (continued pretrained from Qwen3.5). At the same time, it maintains strong general reasoning, multimodal understanding, and agent capabilities.\n\n### Features\n\n- **Scientific task scaling with full-chain training.** Intern-S2-Preview scales hundreds of professional scientific tasks from pre-training to RL, enabling strong performance across multiple specialized domains at only 35B parameters. It further strengthens spatial modeling for small-molecule structures and introduces real-valued prediction modules, making it the first open-source model with both material crystal structure generation capability and strong general capabilities. \n\n- **Enhanced agent capabilities for scientific workflows.** Intern-S2-Preview significantly improves agentic abilities over the previous generation, achieving strong results on multiple scientific agent benchmarks.\n\n- **Efficient RL reasoning with MTP and CoT compression.** During RL, Intern-S2-Preview adopts shared-weight MTP with KL loss to reduce the mismatch between training and inference behavior, substantially improving MTP accept rate and token generation speed. It also introduces CoT compression techniques to shorten responses while preserving strong reasoning capability, achieving improvements in both performance and efficiency. \n\n- **Upgraded time-series Modeling** for better physical signal representation; supports long, heterogeneous time-series (10^0–10^6 points).\n\n\u003cfigure\u003e\n  \u003cimg src=\"./figs/efficiency.jpg\" alt=\"efficient RL reasoning with MTP and CoT compression\"\u003e\n  \u003cfigcaption\u003eFig1: Reasoning Efficiency on Complex Math Benchmarks. Accuracy vs. Average Response Length. Intern-S2-Preview (red star) significantly outperforms trillion-scale Intern-S1-Pro (red circle), and achieving higher accuracy with better token efficiency among medium-size models.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### Performance\n\nWe evaluate the Intern-S2-Preview on various benchmarks, including general datasets and scientific datasets. We report the performance comparison with the recent VLMs and LLMs below. \n\n![performance](./figs/performance.png)\n\n\n\u003e **Note**: \u003cu\u003eUnderline\u003c/u\u003e means the best performance among open-sourced models, **Bold** indicates the best performance among all models.\n\nWe use the [OpenCompass](https://github.com/open-compass/OpenCompass/) and [VLMEvalKit](https://github.com/open-compass/vlmevalkit) to evaluate all models. For text reasoning benchmarks, Intern-S2-Preview is evaluated with a maximum inference length of 128K tokens, while for multimodal benchmarks, it is evaluated with a maximum inference length of 64K tokens.\n\n\n## Quick Start\n\n### Sampling Parameters\n\nWe recommend using the following hyperparameters to ensure better results\n\n```python\ntop_p = 0.95\ntop_k = 50\nmin_p = 0.0\ntemperature = 0.8\n```\n\n### Serving\n\nIntern-S2-Preview can be deployed using any of the following LLM inference frameworks:\n\n- LMDeploy\n- vLLM\n- SGLang\n\nDetailed deployment examples for these frameworks are available in the [Model Deployment Guide](./deployment_guide.md).\n\n\n## Advanced Usage\n\n### Tool Calling\n\nTool Calling lets the model extend its capabilities by invoking external tools and APIs. The example below shows how to use it to fetch the latest weather forecast via an OpenAI-compatible API (based on lmdeploy api server).\n\n```python      \n      \n\nfrom openai import OpenAI\nimport json\n\n\ndef get_current_temperature(location: str, unit: str = \"celsius\"):\n    \"\"\"Get current temperature at a location.\n\n    Args:\n        location: The location to get the temperature for, in the format \"City, State, Country\".\n        unit: The unit to return the temperature in. Defaults to \"celsius\". (choices: [\"celsius\", \"fahrenheit\"])\n\n    Returns:\n        the temperature, the location, and the unit in a dict\n    \"\"\"\n    return {\n        \"temperature\": 26.1,\n        \"location\": location,\n        \"unit\": unit,\n    }\n\n\ndef get_temperature_date(location: str, date: str, unit: str = \"celsius\"):\n    \"\"\"Get temperature at a location and date.\n\n    Args:\n        location: The location to get the temperature for, in the format \"City, State, Country\".\n        date: The date to get the temperature for, in the format \"Year-Month-Day\".\n        unit: The unit to return the temperature in. Defaults to \"celsius\". (choices: [\"celsius\", \"fahrenheit\"])\n\n    Returns:\n        the temperature, the location, the date and the unit in a dict\n    \"\"\"\n    return {\n        \"temperature\": 25.9,\n        \"location\": location,\n        \"date\": date,\n        \"unit\": unit,\n    }\n\ndef get_function_by_name(name):\n    if name == \"get_current_temperature\":\n        return get_current_temperature\n    if name == \"get_temperature_date\":\n        return get_temperature_date\n\ntools = [{\n    'type': 'function',\n    'function': {\n        'name': 'get_current_temperature',\n        'description': 'Get current temperature at a location.',\n        'parameters': {\n            'type': 'object',\n            'properties': {\n                'location': {\n                    'type': 'string',\n                    'description': 'The location to get the temperature for, in the format \\'City, State, Country\\'.'\n                },\n                'unit': {\n                    'type': 'string',\n                    'enum': [\n                        'celsius',\n                        'fahrenheit'\n                    ],\n                    'description': 'The unit to return the temperature in. Defaults to \\'celsius\\'.'\n                }\n            },\n            'required': [\n                'location'\n            ]\n        }\n    }\n}, {\n    'type': 'function',\n    'function': {\n        'name': 'get_temperature_date',\n        'description': 'Get temperature at a location and date.',\n        'parameters': {\n            'type': 'object',\n            'properties': {\n                'location': {\n                    'type': 'string',\n                    'description': 'The location to get the temperature for, in the format \\'City, State, Country\\'.'\n                },\n                'date': {\n                    'type': 'string',\n                    'description': 'The date to get the temperature for, in the format \\'Year-Month-Day\\'.'\n                },\n                'unit': {\n                    'type': 'string',\n                    'enum': [\n                        'celsius',\n                        'fahrenheit'\n                    ],\n                    'description': 'The unit to return the temperature in. Defaults to \\'celsius\\'.'\n                }\n            },\n            'required': [\n                'location',\n                'date'\n            ]\n        }\n    }\n}]\n\n\n\nmessages = [\n    {'role': 'user', 'content': 'Today is 2024-11-14, What\\'s the temperature in San Francisco now? How about tomorrow?'}\n]\n\nopenai_api_key = \"EMPTY\"\nopenai_api_base = \"http://0.0.0.0:23333/v1\"\nclient = OpenAI(\n    api_key=openai_api_key,\n    base_url=openai_api_base,\n)\nmodel_name = client.models.list().data[0].id\nresponse = client.chat.completions.create(\n    model=model_name,\n    messages=messages,\n    max_tokens=32768,\n    temperature=0.8,\n    top_p=0.95,\n    extra_body=dict(spaces_between_special_tokens=False),\n    tools=tools)\nprint(response.choices[0].message)\nmessages.append(response.choices[0].message)\n\nfor tool_call in response.choices[0].message.tool_calls:\n    tool_call_args = json.loads(tool_call.function.arguments)\n    tool_call_result = get_function_by_name(tool_call.function.name)(**tool_call_args)\n    tool_call_result = json.dumps(tool_call_result, ensure_ascii=False)\n    messages.append({\n        'role': 'tool',\n        'name': tool_call.function.name,\n        'content': tool_call_result,\n        'tool_call_id': tool_call.id\n    })\n\nresponse = client.chat.completions.create(\n    model=model_name,\n    messages=messages,\n    temperature=0.8,\n    top_p=0.95,\n    extra_body=dict(spaces_between_special_tokens=False),\n    tools=tools)\nprint(response.choices[0].message)\n```\n\n### Switching Between Thinking and Non-Thinking Modes\n\nIntern-S2-Preview enables thinking mode by default, enhancing the model's reasoning capabilities to generate higher-quality responses. This feature can be disabled by setting `enable_thinking=False` in `tokenizer.apply_chat_template`\n\n```python\ntext = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True,\n    enable_thinking=False  # think mode indicator\n)\n```\n\nWhen serving Intern-S2-Preview models, you can dynamically control the thinking mode by adjusting the `enable_thinking` parameter in your requests.\n\n```python\nfrom openai import OpenAI\nimport json\n\nmessages = [\n{\n    'role': 'user',\n    'content': 'who are you'\n}, {\n    'role': 'assistant',\n    'content': 'I am an AI'\n}, {\n    'role': 'user',\n    'content': 'AGI is?'\n}]\n\nopenai_api_key = \"EMPTY\"\nopenai_api_base = \"http://0.0.0.0:23333/v1\"\nclient = OpenAI(\n    api_key=openai_api_key,\n    base_url=openai_api_base,\n)\nmodel_name = client.models.list().data[0].id\n\nresponse = client.chat.completions.create(\n    model=model_name,\n    messages=messages,\n    temperature=0.8,\n    top_p=0.95,\n    max_tokens=2048,\n    extra_body={\n        \"chat_template_kwargs\": {\"enable_thinking\": False}\n    }\n)\nprint(json.dumps(response.model_dump(), indent=2, ensure_ascii=False))\n```\n\n\u003e Note: We do not recommend disabling thinking mode for agentic tasks.\n\n\n### Time Series Demo\n\nTime series inference is currently only supported in LMDeploy. To get started, download and deploy Intern-S2-Preview with LMDeploy by following the [Model Deployment Guide](./deployment_guide.md).\nBelow is an example of detecting earthquake events from a time series signal file. Additional data types and functionalities are also supported.\n\n**Please note**: this demo is slightly different from the one in [Intern-S1-Pro](https://huggingface.co/internlm/Intern-S1-Pro#time-series-demo). The main difference is that in the messages content, you need to provide time_series_url first, followed by the text prompt. Please adapt your implementation based on this demo.\n\n```\nfrom openai import OpenAI\nfrom lmdeploy.vl.utils import encode_time_series_base64\n\nopenai_api_key = \"EMPTY\"\nopenai_api_base = \"http://0.0.0.0:8000/v1\"\nclient = OpenAI(\n    api_key=openai_api_key,\n    base_url=openai_api_base,\n)\nmodel_name = client.models.list().data[0].id\n\n\ndef send_base64(file_path: str, sampling_rate: int = 100):\n    \"\"\"base64-encoded time-series data.\"\"\"\n\n    # encode_time_series_base64 accepts local file paths and http urls,\n    # encoding time-series data (.npy, .csv, .wav, .mp3, .flac, etc.) into base64 strings.\n    base64_ts = encode_time_series_base64(file_path)\n\n    messages = [\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"time_series_url\",\n                    \"time_series_url\": {\n                        \"url\": f\"data:time_series/npy;base64,{base64_ts}\",\n                        \"sampling_rate\": sampling_rate\n                    },\n                },\n                {\n                    \"type\": \"text\",\n                    \"text\": \"Please determine whether an Earthquake event has occurred in the provided time-series data. If so, please specify the starting time point indices of the P-wave and S-wave in the event.\"\n                },\n            ],\n        }\n    ]\n\n    return client.chat.completions.create(\n        model=model_name,\n        messages=messages,\n        temperature=0,\n        max_tokens=200,\n        extra_body={\n            \"chat_template_kwargs\": {\"enable_thinking\": False}\n        }\n    )\n\n\ndef send_http_url(url: str, sampling_rate: int = 100):\n    \"\"\"http(s) url pointing to the time-series data.\"\"\"\n    messages = [\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"time_series_url\",\n                    \"time_series_url\": {\n                        \"url\": url,\n                        \"sampling_rate\": sampling_rate\n                    },\n                },\n                {\n                    \"type\": \"text\",\n                    \"text\": \"Please determine whether an Earthquake event has occurred in the provided time-series data. If so, please specify the starting time point indices of the P-wave and S-wave in the event.\"\n                },\n            ],\n        }\n    ]\n\n    return client.chat.completions.create(\n        model=model_name,\n        messages=messages,\n        temperature=0,\n        max_tokens=200,\n        extra_body={\n            \"chat_template_kwargs\": {\"enable_thinking\": False}\n        }\n    )\n\n\ndef send_file_url(file_path: str, sampling_rate: int = 100):\n    \"\"\"file url pointing to the time-series data.\"\"\"\n    messages = [\n        {\n            \"role\": \"user\",\n            \"content\": [\n                {\n                    \"type\": \"time_series_url\",\n                    \"time_series_url\": {\n                        \"url\": f\"file://{file_path}\",\n                        \"sampling_rate\": sampling_rate\n                    },\n                },\n                {\n                    \"type\": \"text\",\n                    \"text\": \"Please determine whether an Earthquake event has occurred in the provided time-series data. If so, please specify the starting time point indices of the P-wave and S-wave in the event.\"\n                },\n            ],\n        }\n    ]\n\n    return client.chat.completions.create(\n        model=model_name,\n        messages=messages,\n        temperature=0,\n        max_tokens=200,\n        extra_body={\n            \"chat_template_kwargs\": {\"enable_thinking\": False}\n        }\n    )\n\nresponse = send_base64(\"./0092638_seism.npy\")\n# response = send_http_url(\"https://huggingface.co/internlm/Intern-S1-Pro/raw/main/0092638_seism.npy\")\n# response = send_file_url(\"./0092638_seism.npy\")\n\nprint(response.choices[0].message)\n\n```\n\n## Agent Integration\n\nIntern-S2-Preview can be plugged into agent frameworks in two ways: connecting to a **self-hosted deployment**, or calling the **official InternLM API**. Below we cover both, with examples for agent frameworks (OpenClaw, Hermes, etc.) and for Claude Code.\n\n### 1. Self-hosted Deployment (LMDeploy as an example)\n\nFirst, serve the model with LMDeploy following the [Model Deployment Guide](./deployment_guide.md). The example below assumes the server is running at `http://0.0.0.0:23333`.\n\n#### Connecting Agent Frameworks\n\nMost agent frameworks (OpenClaw, Hermes, etc.) accept an OpenAI-compatible endpoint. Point them at the LMDeploy server base url `http://0.0.0.0:23333/v1`. \n\nYou can check the connection with the following command:\n\n```bash\ncurl http://0.0.0.0:23333/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer EMPTY\" \\\n  -d '{\n    \"model\": \"internlm/Intern-S2-Preview\",\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Hello\"}\n    ],\n    \"temperature\": 0.8,\n    \"top_p\": 0.95\n  }'\n```\n\nOr you can configure your agent framework with the environment variables\n\n```bash\nexport OPENAI_API_KEY=EMPTY\nexport OPENAI_BASE_URL=http://0.0.0.0:23333/v1\nexport OPENAI_MODEL=internlm/Intern-S2-Preview\n```\n\nRemember to launch LMDeploy with `--tool-call-parser interns2-preview` so tool calls are parsed correctly.\n\n#### Connecting Claude Code\n\nLMDeploy exposes an Anthropic-compatible `/v1/messages` endpoint that Claude Code can talk to directly. Add the following to `~/.claude/settings.json`:\n\n```json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"http://127.0.0.1:23333\",\n    \"ANTHROPIC_AUTH_TOKEN\": \"dummy\",\n    \"ANTHROPIC_MODEL\": \"internlm/Intern-S2-Preview\",\n    \"ANTHROPIC_CUSTOM_MODEL_OPTION\": \"internlm/Intern-S2-Preview\"\n  }\n}\n```\n\nFor a full walkthrough (curl verification, model routing, troubleshooting), see [LMDeploy × Claude Code](https://lmdeploy.readthedocs.io/en/latest/intergration/claude_code.html).\n\n### 2. Official Intern API\n\nIf you do not want to self-host, you can use the official Intern API. Register at [internlm.intern-ai.org.cn](https://internlm.intern-ai.org.cn/) and create an API token (`sk-xxxxxxxx`).\n\n#### Connecting Agent Frameworks\n\nThe service is OpenAI-compatible, so any agent framework works. You can set the base url to `https://chat.intern-ai.org.cn/api/v1` and the model name to `intern-s2-preview` in the cli or config file.\n\nYou can check the connection with the following command:\n\n```bash\ncurl https://chat.intern-ai.org.cn/api/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer sk-xxxxxxxx\" \\\n  -d '{\n    \"model\": \"intern-s2-preview\",\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Hello\"}\n    ],\n    \"temperature\": 0.8,\n    \"top_p\": 0.95\n  }'\n```\n\nRefer to the [Intern API documentation](https://internlm.intern-ai.org.cn/api/document?lang=en) for the current endpoint, available model names, rate limits, and advanced parameters.\n\n#### Connecting Claude Code\n\nClaude Code can route to the official Intern API by pointing `ANTHROPIC_BASE_URL` at the Intern Anthropic-compatible gateway:\n\n```json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"https://chat.intern-ai.org.cn\",\n    \"ANTHROPIC_AUTH_TOKEN\": \"your-api-token\",\n    \"ANTHROPIC_MODEL\": \"intern-s2-preview\",\n    \"ANTHROPIC_SMALL_FAST_MODEL\": \"intern-s2-preview\"\n  }\n}\n```\n\nThen start claude code with the following command:\n\n```bash\nclaude --model intern-s2-preview\n```\n\nFor step-by-step setup, see [Intern API × Claude Code Integration](https://internlm.intern-ai.org.cn/docEn/docs/Claude-Code-Integration).\n\n","ReadMeTips":null,"RelatedArxivId":[],"RelatedPaper":[],"Revision":"master","Stars":35,"StorageSize":73257328736,"Studios":[],"SubVisionFoundation":"","SupportApiInference":false,"SupportDashDeployment":0,"SupportDashInference":0,"SupportDashTraining":0,"SupportDeployment":0,"SupportExperience":1,"SupportFinetuning":0,"SupportFlexTrain":0,"SupportInference":"txt2txt","SupportPaiModelGallery":null,"SupportPaiSdk":0,"SupportPivotEval":false,"SwingDeployInfo":null,"Tags":[],"Tasks":[{"ChineseName":"视觉多模态理解","Description":"","DomainName":"multi-modal","Id":295,"IsExhibition":true,"IsHot":0,"IsLeaf":true,"IsLoginRequired":true,"IsRetrieval":true,"Level":1,"Name":"image-text-to-text","ParentId":-1,"ParentTask":null,"Sorting":0,"SupportWidgets":false,"TypicalModel":"","WidgetConfig":"{}","WidgetValidator":""}],"Tools":[],"TriggerWords":null,"Visibility":5,"VisionFoundation":"","_":null,"widgets":[{"enable":true,"enabled":false,"examples":[{"inputs":[{"data":"你好","name":"text"}],"name":"","parameters":null,"title":""}],"inferencespec":null,"inputs":null,"parameters":null,"task":"image-text-to-text","template":{"general":false,"thinking":true}}]},"Message":"success","RequestId":"dc78d52a-1778-44ec-ba00-913b04e9324c","Success":true}