codeinterpreter-api icon indicating copy to clipboard operation
codeinterpreter-api copied to clipboard

[Feature] Adding the other models

Open ValeriaWong opened this issue 2 years ago • 3 comments

Firstly, I want to extend my sincere appreciation for the fantastic work you've put into this project!

As indicated by the title, I'm curious to know if there's a possibility of integrating API calls for additional models?

Furthermore, have you considered incorporating local model calls as part of the features? There might be users who are keen on more than just API calls and are interested in running code interpreters on local models like vicuna, llama, chatglm, etc. If there are plans to expand in this direction, I would be more than happy to offer my assistance.

Looking forward to your response, and once again, thanks for your tremendous efforts!

ValeriaWong avatar Jul 18 '23 12:07 ValeriaWong

Hey thanks! I am currently working on another branch in implementing this so you can add any LangChain BaseChatModel as argument into the Session. This could be also a local model if you if it works with the chat interface.

shroominic avatar Jul 18 '23 19:07 shroominic

@shroominic so you're saying I'll be able to load up my local llama-2 model like below and have it be able to execute code in this CodeBox env?

example using local 13B llama2:

template = """Question: {question}

Answer: Let's work this out in a step by step way to be sure we have the right answer."""

prompt = PromptTemplate(template=template, input_variables=["question"])

callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])

n_gpu_layers = 20
n_batch = 1024

llm = LlamaCpp(
    model_path="./llama2-chat-ggml-q4_0.bin",
    n_gpu_layers=n_gpu_layers,
    n_batch=n_batch,
    n_ctx=2048,
    max_tokens=1500,
    f16_kv=True, 
    callback_manager=callback_manager,
    verbose=True,
)

llm_chain = LLMChain(prompt=prompt, llm=llm)

question = "can you give me a full modern UI login page using android jetpack compose"

llm_chain.run(question)

itsPreto avatar Jul 19 '23 22:07 itsPreto

yeah I am currently working in the dev branch on making the project work with a ConversationalChatAgent which would enable other chat models but the file modifications chain still needs to get rewritten or adjusted

shroominic avatar Jul 21 '23 23:07 shroominic