Merge pull request #5099 from ethereum/remixai_llama31

minor
pull/5127/head
STetsing 3 months ago committed by GitHub
commit 6e2eacdf52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      apps/remixdesktop/src/lib/InferenceServerManager.ts
  2. 56
      libs/remix-ai-core/src/types/models.ts
  3. 4
      libs/remix-ui/remix-ai/src/lib/components/Default.tsx

@ -84,10 +84,13 @@ export class InferenceManager implements ICompletions {
if (this.inferenceProcess === null) await this._startServer() if (this.inferenceProcess === null) await this._startServer()
console.log('Initializing model request', model.modelType)
switch (model.modelType) { switch (model.modelType) {
case ModelType.CODE_COMPLETION_INSERTION || ModelType.CODE_COMPLETION:{ case ModelType.CODE_COMPLETION_INSERTION || ModelType.CODE_COMPLETION:{
console.log('Initializing Completion Model')
const res = await this._makeRequest('init_completion', { model_path: model.downloadPath }) const res = await this._makeRequest('init_completion', { model_path: model.downloadPath })
console.log('code completion res is', res?.data?.status)
if (res?.data?.status === "success") { if (res?.data?.status === "success") {
this.isReady = true this.isReady = true
console.log('Completion Model initialized successfully') console.log('Completion Model initialized successfully')
@ -112,7 +115,7 @@ export class InferenceManager implements ICompletions {
} }
} }
this.stateTimer.start() this.stateTimer.start() // double call on init completion and general
this.selectedModels.push(model) this.selectedModels.push(model)
} catch (error) { } catch (error) {
console.error('Error initializing the model', error) console.error('Error initializing the model', error)

@ -10,60 +10,22 @@ const DefaultModels = (): IModel[] => {
name: 'DeepSeek', name: 'DeepSeek',
modelOP: RemoteBackendOPModel.DEEPSEEK, modelOP: RemoteBackendOPModel.DEEPSEEK,
task: 'text-generation', task: 'text-generation',
modelName: 'deepseek-coder-1.3b-instruct.gguf', modelName: 'deepseek-coder-6.7b-instruct-q4.gguf',
downloadUrl: 'https://huggingface.co/TheBloke/deepseek-coder-1.3b-instruct-GGUF/resolve/main/deepseek-coder-1.3b-instruct.Q4_K_M.gguf?download=true', downloadUrl: 'https://drive.usercontent.google.com/download?id=13sz7lnEhpQ6EslABpAKl2HWZdtX3d9Nh&confirm=xxx',
modelType: ModelType.CODE_COMPLETION,
modelReqs: { backend: 'llamacpp', minSysMemory: 2, GPURequired: false, MinGPUVRAM: 2 }
};
const model2: IModel = {
name: 'DeepSeek',
modelOP: RemoteBackendOPModel.DEEPSEEK,
task: 'text-generation',
modelName: 'deepseek-coder-6.7b-instruct.gguf',
downloadUrl: 'https://huggingface.co/TheBloke/deepseek-coder-6.7B-instruct-GGUF/resolve/main/deepseek-coder-6.7b-instruct.Q4_K_M.gguf?download=true',
modelType: ModelType.GENERAL, modelType: ModelType.GENERAL,
modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: true, MinGPUVRAM: 8 } modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: false, MinGPUVRAM: 8 }
};
const model3: IModel = {
name: 'DeepSeekTransformer',
modelOP: RemoteBackendOPModel.DEEPSEEK,
task: 'text-generation',
modelName: 'Xenova/deepseek-coder-1.3b-base',
downloadUrl: 'Xenova/deepseek-coder-1.3b-base',
modelType: ModelType.CODE_COMPLETION_INSERTION,
modelReqs: { backend: 'transformerjs', minSysMemory: 2, GPURequired: false, MinGPUVRAM: 2 }
};
const model4: IModel = {
name: 'DeepSeek',
modelOP: RemoteBackendOPModel.DEEPSEEK,
task: 'text-generation',
modelName: 'deepseek-coder-1.3b-base.gguf',
downloadUrl: 'https://huggingface.co/TheBloke/deepseek-coder-1.3b-base-GGUF/resolve/main/deepseek-coder-1.3b-base.Q4_K_M.gguf?download=true',
modelType: ModelType.CODE_COMPLETION_INSERTION,
modelReqs: { backend: 'llamacpp', minSysMemory: 2, GPURequired: false, MinGPUVRAM: 2 }
}; };
const model2: IModel = {
const model5: IModel = {
name: 'DeepSeek', name: 'DeepSeek',
modelOP: RemoteBackendOPModel.DEEPSEEK, modelOP: RemoteBackendOPModel.DEEPSEEK,
task: 'text-generation', task: 'text-generation',
modelName: 'deepseek-coder-6.7B-base-GGUF', modelName: 'deepseek-coder-1.3b-base-q4.gguf',
downloadUrl: 'https://huggingface.co/TheBloke/deepseek-coder-6.7B-base-GGUF/resolve/main/deepseek-coder-6.7b-base.Q4_K_M.gguf?download=true', downloadUrl: 'https://drive.usercontent.google.com/download?id=13UNJuB908kP0pWexrT5n8i2LrhFaWo92&confirm=xxx',
modelType: ModelType.CODE_COMPLETION_INSERTION, modelType: ModelType.CODE_COMPLETION_INSERTION,
modelReqs: { backend: 'llamacpp', minSysMemory: 2, GPURequired: false, MinGPUVRAM: 2 } modelReqs: { backend: 'llamacpp', minSysMemory: 2, GPURequired: false, MinGPUVRAM: 2 }
}; };
const model6: IModel = { const model3: IModel = {
name: 'DeepSeek',
modelOP: RemoteBackendOPModel.DEEPSEEK,
task: 'text-generation',
modelName: 'DeepSeek-Coder-V2-Lite-Base.Q2_K.gguf',
downloadUrl: 'https://huggingface.co/QuantFactory/DeepSeek-Coder-V2-Lite-Base-GGUF/resolve/main/DeepSeek-Coder-V2-Lite-Base.Q2_K.gguf?download=true',
modelType: ModelType.GENERAL,
modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: false, MinGPUVRAM: 8 }
};
const model7: IModel = {
name: 'llaama3.1_8B', name: 'llaama3.1_8B',
modelOP: RemoteBackendOPModel.CODELLAMA, modelOP: RemoteBackendOPModel.CODELLAMA,
task: 'text-generation', task: 'text-generation',
@ -73,7 +35,7 @@ const DefaultModels = (): IModel[] => {
modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: false, MinGPUVRAM: 8 } modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: false, MinGPUVRAM: 8 }
}; };
const model8: IModel = { const model4: IModel = {
name: 'llaama3.1_8B_instruct', name: 'llaama3.1_8B_instruct',
modelOP: RemoteBackendOPModel.CODELLAMA, modelOP: RemoteBackendOPModel.CODELLAMA,
task: 'text-generation', task: 'text-generation',
@ -83,7 +45,7 @@ const DefaultModels = (): IModel[] => {
modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: false, MinGPUVRAM: 8 } modelReqs: { backend: 'llamacpp', minSysMemory: 8, GPURequired: false, MinGPUVRAM: 8 }
}; };
return [model1, model2, model3, model4, model5, model6, model7, model8]; return [model1, model2, model3, model4];
} }
const getModel = async (name: string): Promise<IModel | undefined> => { const getModel = async (name: string): Promise<IModel | undefined> => {

@ -40,7 +40,7 @@ export const Default = (props) => {
style={{ color: 'black' }} style={{ color: 'black' }}
></i> ></i>
<span className="position-relative text-ai text-sm pl-1" <span className="position-relative text-ai text-sm pl-1"
style={{fontSize: "x-small", alignSelf: "end"}}>Search</span> style={{ fontSize: "x-small", alignSelf: "end" }}>Search</span>
</button> </button>
<button className="remix_ai_plugin_download_button text-ai pl-2 pr-0 py-0 d-flex" <button className="remix_ai_plugin_download_button text-ai pl-2 pr-0 py-0 d-flex"
@ -70,7 +70,7 @@ export const Default = (props) => {
<button className="remix_ai_plugin_download_button text-ai pl-2 pr-0 py-0 d-flex" <button className="remix_ai_plugin_download_button text-ai pl-2 pr-0 py-0 d-flex"
onClick={async () => { onClick={async () => {
props.plugin.call("remixAI", 'initialize', DefaultModels()[3], DefaultModels()[1]); props.plugin.call("remixAI", 'initialize', DefaultModels()[3], DefaultModels()[7]);
}} }}
> Init Model </button> > Init Model </button>
</div> </div>

Loading…
Cancel
Save