Package: open-code-interpreter
Hosting and Spaces:Support Project:Welcome to Open-Code-Interpreter 🎉,an innovative open-source and free alternative to traditional Code Interpreters. This is powerful tool and it also leverages the power ofGPT 3.5 Turbo,PALM 2,Groq,HuggingFace modelslikeCode-llama,Mistral 7b,Wizard Coder, and many more to transform your instructions into executable code forfreeandsafeto use environments and even hasVision Modelsfor Image Processing available.Open-Code-Interpreteris more than just a code generator. It's a versatile tool that can execute a wide range of tasks. Whether you need to find files in your system 📂, save images from a website and convert them into a different format 🖼️, create a GIF 🎞️, edit videos 🎥, or even analyze files for data analysis and creating graphs 📊, Open-Code-Interpreter can handle it all.After processing your instructions,Open-Code-Interpreterexecutes the generated code and provides you with the result. This makes it an invaluable tool for developers 💻, data scientists 🧪, and anyone who needs to quickly turn ideas into working code and now withVision Modelsit can also process images and videos.Designed with versatility in mind,Open-Code-Interpreterworks seamlessly on every operating system, includingWindows, MacOS, and Linux. So, no matter what platform you're on, you can take advantage of this powerful tool 💪.Experience the future of code interpretation with Open-Code-Interpreter today! 🚀Why this is Unique Interpreter?The distinguishing feature of this interpreter, as compared to others, is itscommitment to remain free 🆓. It does not require any model to download or follow totedious processesor methods for execution. It is designed to besimpleandfreefor all users and works on all major OSWindows,Linux,MacOSFuture Plans:🎯 We plan to integrateGPT 3.5models.🎯 We have added support forGPT 3.5models.🌐 .We plan to provideVertex AI (PALM 2)models..We have added support forPALM-2model usingLiteLLM🔗We plan to provide API Base change usingLiteLLM. Added Support forLiteLLM🤖 MoreHugging Facemodels with free-tier.💻 Support for moreOperating Systems.📝 Support forMulti-ModalforTextandVision.📊 Support forGoogleandOpenAIVision Models.Support forLocalmodels viaLLM Studio.Table of ContentsFeaturesInstallationUsageExamplesSettingsContributingVersioningLicenseAcknowledgments📥InstallationInstalltion with Python package manager.To install Open-Code-Interpreter, run the following command:pipinstallopen-code-interpreterTo run the interpreter with Python:interpreter-m'gemini-pro'-md'code'-dcMake sure you install required packages before running the interpreter.And you have API keys setup in the.envfile.Installtion with GitTo get started with Open-Code-Interpreter, follow these steps:Clone the repository:git clone https://github.com/haseeb-heaven/open-code-interpreter.git
cd open-code-interpreterInstall the required packages:pipinstall-rrequirements.txtSetup the Keys required.HUGGING FACE API Key setup.Step 1:Obtain the HuggingFace API key.Step 2:Visit the following URL:HuggingFace Tokensand get your Access Token.Step 3:Save the token in a.envfile as:echo"HUGGINGFACE_API_KEY=Your Access Token">.envGoogle GEMINI and PALM-2 API Key setup.Step 1:Obtain the Google Palm API key.Step 2:Visit the following URL:Google AI StudioStep 3:Click on theCreate API Keybutton.Step 4:The generated key is your API key. Please make sure tocopyit andpasteit in the required field below.echo"PALM_API_KEY=Your API Key">.envecho"GEMINI_API_KEY=Your API Key">.envOpenAI API Key setup.Step 1:Obtain the OpenAI API key.Step 2:Visit the following URL:OpenAI DashboardStep 3:Sign up for an account or log in if you already have one.Step 4:Navigate to the API section in your account dashboard.Step 5:Click on theCreate New Keybutton.Step 6:The generated key is your API key. Please make sure tocopyit andpasteit in the required field below.echo"OPENAI_API_KEY=Your API Key">.envGroq AI API Key setup.Step 1:Obtain the GroqAI API key.Step 2:Visit the following URL:Groq AI ConsoleStep 3:Sign up for an account or log in if you already have one.Step 4:Navigate to the API section in your account.Step 5:Click on theCreate API Keybutton.Step 6:The generated key is your API key. Please make sure tocopyit andpasteit in the required field below.echo"GROQ_API_KEY=Your API Key">.envAnthropic AI API Key setup.Step 1:Obtain theAnthropicAccess by request.Step 2:Obtain the AnthropicAPI KeyAnthropic AI ConsoleStep 3:Sign up for an account or log in if you already have one.Step 4:Navigate to the API Keys section in your account.Step 5:Click on theCreate Keybutton.Step 6:The generated key is your API key. Please make sure tocopyit andpasteit in the required field below.echo"ANTHROPIC_API_KEY=Your API Key">.envOffline models setup.This Interpreter supports offline models viaLLM Studioso to download it fromhereand follow the steps below.Download any model fromLLM StudiolikePhi-2,Code-Llama,Mistral.Then in the app go toLocal Serveroption and select the model.Start the server and copy theURL.Open config fileconfigs/offline-model.configand paste theURLin theapi_basefield.Now you can use the model with the interpreter set the model name tooffline-modeland run the interpreter.Run the interpreter with Python:Running with Python.pythoninterpreter.py-md'code'-m'gpt-3.5-turbo'-dcRun the interpreter directly:Running Interpreter without Python (Executable MacOs/Linux only)../interpreter-md'code'-m'gpt-3.5-turbo'-dc🌟Features🚀 Code Execution: Open-Code-Interpreter can execute the code generated from your instructions.💾 Code Save/Update: It has the ability to save the generated code for future use and
edit the code if needed on the fly usingadvanced editor.📡 Offline models: It has the ability to useoffline modelsfor code generation usingLLM Studio.📜 Command History: It has the ability to save all the commands as history.📜 Command Mode: Commands entered with '/' are executed as commands like/executeor/edit.🔄 Mode Selection: It allows you to select the mode of operation. You can choose fromcodefor generating code,scriptfor generating shell scripts, orcommandfor generating single line commands.🧠 Model Selection: You can set the model for code generation. By default, it uses thecode-llamamodel.🌐 Language Selection: You can set the interpreter language to Python orJavaScript. By default, it usesPython.👀 Code Display: It can display the generated code in the output, allowing you to review the code before execution.💻 Cross-Platform: Open-Code-Interpreter works seamlessly on every operating system, including Windows, MacOS, and Linux.🤝 Integration with HuggingFace: It leverages the power of HuggingFace models like Code-llama, Mistral 7b, Wizard Coder, and many more to transform your instructions into executable code.🎯 Versatility: Whether you need to find files in your system, save images from a website and convert them into a different format, create a GIF, edit videos, or even analyze files for data analysis and creating graphs, Open-Code-Interpreter can handle it all.🛠️UsageTo use Open-Code-Interpreter, use the following command options:List of allmodesare:code- Generates code from your instructions.script- Generates shell scripts from your instructions.command- Generates single line commands from your instructions.vision- Generates description of image or video.List of allmodelsare (Contribute - MORE):gpt-3.5-turbo- Generates code using the GPT 3.5 Turbo model.gpt-4- Generates code using the GPT 4 model.gemini-pro- Generates code using the Gemini Pro model.palm-2- Generates code using the PALM 2 model.claude-2- Generates code using the AnthropicAI Claude-2 model.groq-mixtral- Generates code using the Groq Mixtral model.groq-llama2- Generates code using the Groq Llama2 model.code-llama- Generates code using the Code-llama model.code-llama-phind- Generates code using the Code-llama Phind model.mistral-7b- Generates code using the Mistral 7b model.wizard-coder- Generates code using the Wizard Coder model.star-chat- Generates code using the Star Chat model.offline-model- Generates code using the Offline model.Basic usage (with least options)pythoninterpreter.py-dcUsing different models (replace 'model-name' with your chosen model)pythoninterpreter.py-md'code'-m'model-name'-dcUsing different modes (replace 'mode-name' with your chosen mode)pythoninterpreter.py-m'model-name'-md'mode-name'Using auto executionpythoninterpreter.py-m'wizard-coder'-md'code'-dc-eSaving the codepythoninterpreter.py-m'code-llama'-md'code'-sSelecting a language (replace 'language-name' with your chosen language)pythoninterpreter.py-m'gemini-pro'-md'code'-s-l'language-name'Interpreter Commands 🖥️Here are the available commands:📝/save- Save the last code generated.✏️/edit- Edit the last code generated.▶️/execute- Execute the last code generated.🔄/mode- Change the mode of interpreter.🔄/model- Change the model for interpreter.📦/install- Install a package from npm or pip.🌐/language- Change the language of the interpreter.🧹/clear- Clear the screen.🆘/help- Display this help message.📝/version- Display the version of the interpreter.🚪/exit- Exit the interpreter.📜/log- Toggle different modes of logging.⏫/upgrade- Upgrade the interpreter.💻/shell- Access the shell.📖ExamplesCode Interpreter DemoExample of GPT 3.5 Turbo.Example of PALM-2 based onGoogle Vertex AI.Example of Code llama with code mode:Example of Code llama with command mode:Example of Mistral with code mode:⚙️SettingsYou can customize the settings of the current model from the.configfile. It contains all the necessary parameters such astemperature,max_tokens, and more.Steps to add your own custom API ServerTo integrate your own API server for OpenAI instead of the default server, follow these steps:Navigate to theConfigsdirectory.Open the configuration file for the model you want to modify. This could be eithergpt-3.5-turbo.configorgpt-4.config.Add the following line at the end of the file:api_base = https://my-custom-base.comReplacehttps://my-custom-base.comwith the URL of your custom API server.Save and close the file.
Now, whenever you select thegpt-3.5-turboorgpt-4model, the system will automatically use your custom server.Steps to add new Hugging Face model📋 Copy the.configfile and rename it toconfigs/hf-model-new.config.🛠️ Modify the parameters of the model likestart_sep,end_sep,skip_first_line.📝 Set the model name from Hugging Face toHF_MODEL = 'Model name here'.🚀 Now, you can use it like this:python interpreter.py -m 'hf-model-new' -md 'code' -e.📁 Make sure the-m 'hf-model-new'matches the config file inside theconfigsfolder.🤝ContributingIf you're interested in contributing toOpen-Code-Interpreter, we'd love to have you! Please fork the repository and submit a pull request. We welcome all contributions and are always eager to hear your feedback and suggestions for improvements.📌Versioning📌Versioning🚀v1.0- Initial release.📊v1.1- AddedGraphsandChartssupport.🔥v1.2- AddedLiteLLMSupport.🌟v1.3- AddedGPT 3.5Support.🌴v1.4- AddedPALM 2Support.🎉v1.5- AddedGPT 3.5/4models official Support.📝v1.6- Updated Code Interpreter for Documents files (JSON,CSV,XML).🌴v1.7- AddedGemini Pro VisionSupport for Image Processing.🌴v1.8- AddedInterpreter Commands Support.1.8.1- AddedInterpreter CommandsDebugging Support.1.8.2- FixedInterpreter Commands1.8.3- AddedInterpreter CommandsUpgrade and Shell Support.1.8.4- FixedInterpreter Model switcherBug.🗨️v1.9- Added newChat mode🗨️ for Chatting with yourFiles,Dataand more.v1.9.1- FixedUnit TestsandHistory Argsv1.9.2- UpdatedGoogle Visionto adapt LiteLLM instead ofGoogle GenAI*.v1.9.3- AddedLocal ModelsSupport viaLM Studio.🔥v2.0- AddedGroq-AIModelsFastest LLMwith500 Tokens/SecwithCode-LLaMa,Mixtralmodels.v2.0.1- Added AnthropicAI Claude-2,Instant models.📜LicenseThis project is licensed under theMIT License. For more details, please refer to the LICENSE file.Please note the following additional licensing details:TheGPT 3.5/4 modelsare provided byOpenAIand are governed by their own licensing terms. Please ensure you have read and agreed to their terms before using these models. More information can be found atOpenAI's Terms of Use.ThePALM modelsare officially supported by theGoogle PALM 2 API. These models have their own licensing terms and support. Please ensure you have read and agreed to their terms before using these models. More information can be found atGoogle Generative AI's Terms of Service.TheHugging Face modelsare provided byHugging Face Inc.and are governed by their own licensing terms. Please ensure you have read and agreed to their terms before using these models. More information can be found atHugging Face's Terms of Service.🙏AcknowledgmentsWe would like to express our gratitude toHuggingFace,Google,META,OpenAIfor providing the models.A special shout-out to the open-source community. Your continuous support and contributions are invaluable to us.📝 AuthorThis project is created and maintained byHaseeb-Heaven.