MarkTechPost@AI 07月07日 23:20
Better Code Merging with Less Compute: Meet Osmosis-Apply-1.7B from Osmosis AI
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Osmosis AI 开源了 Osmosis-Apply-1.7B,这是一个基于 Qwen3-1.7B 的微调模型,专门设计用于执行高精度和结构化的代码合并任务。该模型借鉴了 IDE 代理,如 Cursor 的“即时应用”功能,针对上下文相关的函数级代码编辑进行了优化。Osmosis-Apply-1.7B 通过使用代码特定的格式化标签、高质量数据集和模型上下文协议 (MCP) 集成,在参数较少的情况下实现了比大型基础模型更强的性能。

💡 Osmosis-Apply-1.7B 是一个针对代码合并任务专门设计的模型,它接收原始代码、编辑集或差异以及预期的合并格式作为输入,并返回修改后的代码块,其中更改应用在 <edit> 标签内,嵌套在 <code> 块中。

✅ 该模型基于 commitpackft 数据集中的约 100,000 个真实世界的提交进行微调,每个训练样本都旨在代表实际的开发者工作流程。奖励结构基于全匹配、语义匹配和不正确或失败的匹配,从而强化了高保真输出,同时允许在风格上存在一些宽松,这与代码审查的实际操作非常相似。

📊 基准测试结果显示,Osmosis-Apply-1.7B 在应用局部更改时表现出色,同时保留了语义、格式和结构。其平均奖励分数优于 Claude 4 Sonnet、GPT-3.5-turbo 和 Gemini-2.5-Flash 等大型 LLM。

⚙️ 该模型原生支持模型上下文协议 (MCP),从而能够使用文件层次结构、函数名和编辑标签进行结构化上下文调用。它遵循 apply-code MCP 规范,简化了 CLI 工具和 IDE 代理中的无缝使用,返回函数级别的更改,并使用结构良好的 XML 风格标签标记编辑。

🚀 Osmosis AI 还发布了一个参考实现,支持本地推理以及与 vLLM 或 Gulp Server 等服务的集成。关键用例包括为用户指定更改提供“即时应用”的 IDE 代理、应用自动重构或基于审查的更改的 CI 机器人以及具有结构感知合并逻辑的代码转换工具。

Osmosis AI has open-sourced Osmosis-Apply-1.7B, a fine-tuned variant of Qwen3-1.7B, designed to perform highly accurate and structured code merge tasks. Drawing inspiration from IDE agents like Cursor’s “instant apply,” Osmosis-Apply-1.7B is optimized for context-sensitive, function-level code edits. The model achieves strong performance with fewer parameters compared to much larger foundation models by leveraging code-specific formatting tags, a high-quality dataset, and Model Context Protocol (MCP) integration.

Purpose-Built for Code Merge Tasks

Unlike general-purpose LLMs that struggle with diff application and semantic merging, Osmosis-Apply-1.7B is trained specifically to apply structured edits at the function or block level. The model takes three structured inputs: (1) the original code, (2) the set of edits or diffs, and (3) the expected merge format. It then returns a revised code block where the change is applied within <edit> tags nested in a <code> block. This format aligns with production-grade expectations and simplifies validation.

Training and Reward Structure

Osmosis-Apply-1.7B was fine-tuned on approximately 100,000 real-world commits from the commitpackft dataset, representing under 15% of the full corpus. Each training sample was structured to represent practical developer workflows. A reward-based post-training system was used:

This reward schema reinforces high-fidelity outputs while allowing for some leniency in stylistic variation, closely mimicking how code reviews operate in practice.

Benchmark Results

Osmosis AI benchmarked the model using a 10,000-sample evaluation from the commitpackft dataset. The average reward scores demonstrate strong performance relative to larger LLMs:

ModelReward Score
Osmosis-Apply-1.7B0.9805
Claude 4 Sonnet0.9328
GPT-3.5-turbo0.8639
Gemini-2.5-Flash0.7745

These results highlight the model’s strength in applying localized changes while preserving semantics, formatting, and structure.

MCP Integration for Developer Workflows

A key feature of the model is its native support for the Model Context Protocol (MCP), enabling structured context invocation with file hierarchies, function names, and edit tags. The model adheres to the apply-code MCP spec, allowing seamless use in CLI tools and IDE agents. It returns changes scoped at the function level and marks edits using well-structured XML-style tags, which simplifies diff tracking and downstream tooling.

Developer Tooling and Use Cases

Osmosis AI has also released a reference implementation that supports both local inference and integration with services like vLLM or Gulp Server. The tooling includes CLI-based usage examples, MCP server implementation, and safe deployment guides.

Key use cases include:

Format and Deployment

The model outputs edits wrapped in <code> and <edit> tags to ensure compatibility with automated validators. Inference-ready versions of the model are provided in multiple formats including safetensors and GGUF for efficient deployment. Osmosis-Apply-1.7B can be hosted locally or served in quantized mode for optimized inference on constrained hardware.

Availability and License

Osmosis-Apply-1.7B is available under the Apache-2.0 license and hosted on both Hugging Face and GitHub. The release includes all necessary scripts for inference, examples for MCP-compliant deployment, and structured formatting guides.

Conclusion

By open-sourcing Osmosis-Apply-1.7B, Osmosis AI addresses a key need for function-level, structure-aware code editing models. Unlike foundation models, this specialized model combines compact size with precision and format alignment. Its MCP integration, reward-based fine-tuning, and syntactic structure support make it an ideal candidate for real-world developer tooling.


Check out the GitHub Page, Hugging Face Page and Technical Details. All credit for this research goes to the researchers of this project. Also, feel free to follow us on Twitter, Youtube and Spotify and don’t forget to join our 100k+ ML SubReddit and Subscribe to our Newsletter.

The post Better Code Merging with Less Compute: Meet Osmosis-Apply-1.7B from Osmosis AI appeared first on MarkTechPost.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Osmosis AI 代码合并 开源模型 MCP 代码编辑
相关文章