Codestral 發佈說明
Mistral AI 推出了 Codestral,這是其首款專門的程式碼模型。Codestral 是一個 22B 開放權重生成式 AI 模型,旨在透過共享的指令與補全 API 端點,藉由生成程式碼、完成函數以及編寫測試來協助開發者。
廣泛的語言支援與核心能力
Codestral 精通超過 80 種程式語言。這包括廣泛使用的語言,如 Python、Java、C、C++、JavaScript 和 Bash,以及更專業的語言,如 Swift 和 Fortran。
為了提高開發者生產力並減少錯誤,該模型支援幾項關鍵功能:
- Code Completion: 補全程式碼函數與部分程式碼。
- Fill-in-the-Middle (FIM): 一種允許模型根據上下文環境來補全程式碼的機制。
- Test Generation: 自動為現有程式碼編寫測試。
效能與基準測試
作為一個 22B 參數模型,Codestral 的定位是為程式碼生成任務優化效能與延遲之間的平衡。
長範圍上下文與儲存庫層級補全
Codestral 具有 32k 上下文視窗,這比競爭模型中常見的 4k、8k 或 16k 視窗要大得多。這個較大的視窗讓 Codestral 在 RepoBench 中表現優於其他模型,RepoBench 是專門為長範圍儲存庫層級程式碼補全而設計的基準測試。
技術基準測試
Mistral AI 在幾個維度上對 Codestral 進行了評估:
- Python: 效能是使用 HumanEval pass@1、MBPP sanitised pass@1(生成能力)、CruxEval(輸出預測)以及 RepoBench EM(長範圍補全)來進行衡量。
- SQL: 效能是使用 Spider 基準測試來進行評估。
- Multi-language Support: 該模型使用 HumanEval pass@1 在 C++、bash、Java、PHP、Typescript 和 C# 進行了評估。
- Fill-in-the-Middle: FIM 在 Python、JavaScript 和 Java 中的效能與 DeepSeek Coder 33B 進行了比較。
部署與存取選項
Codestral 可透過多種存取路徑,根據使用情境提供:
開放權重與授權
Codestral 是一個開放權重的模型,可在 HuggingFace 上下載。它根據 Mistral AI Non-Production License 釋出,允許用於研究與測試。商業授權可根據需求向 Mistral AI 索取。
API 端點
- Dedicated Endpoint (
codestral.mistral.ai): 專為 IDE 外掛程式與應用程式設計,使用者可以提供自己的 API key。此端點目前處於為期 8 週的免費測試期,並設有候補名單限制。 - General API Endpoint (
api.mistral.ai): 可透過 la Plateforme 使用,查詢會按 token 數量計費。這適用於研究、批次查詢或直接向使用者提供結果的第三方應用程式。
自行部署
Codestral 可透過 Mistral AI 的銷售團隊進行自行部署。
生態系統整合
Codestral 已整合至多個開發者工具與框架:
- Application Frameworks: 整合至 LlamaIndex 和 LangChain 以建立代理型應用程式。
- IDE Integrations: 整合至 Continue.dev 和 Tabnine,讓開發者可以在 VSCode 和 JetBrains 環境中,使用 Codestral 進行對話與程式碼生成。
社群與合作夥伴回饋
業界合作夥伴強調了該模型的效率與準確性。顯著的回饋包括:
"Our internal evaluations show that Mistral's new Codestral model significantly reduces the latency of Cody autocomplete while maintaining the quality of the suggested code."
— Quinn Slack, CEO and co-founder of Sourcegraph
"We used Codestral to run a test on our Kotlin-HumanEval benchmark and were impressed with the results. For instance, in the case of the pass rate for T=0.2, Codestral achieved a score of 73.75, surpassing GPT-4-Turbo's score of 72.05 and GPT-3.5-Turbo's score of 54.66."
— Mikhail Evtikhiev, Researcher at JetBrains
Sources
- OriginalCodestral
相關
- Dispatch
- Dispatch
- Dispatch
- Dispatch
- Dispatch