Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build on 2023 to support win-arm64 #244

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,22 @@ Expected a different answer? Re-generate any response of your choosing.
- **Seamless conversations** - Chat with the AI regardless of the maximum token limitations
- **Predefined Actions** - Create your own editor actions or override the existing ones, saving time rewriting the same prompt repeatedly

## Local LLama models

Local llama models are in beta. They should run by just changing settings for Mac
For windows
1. Install WSL/Ubuntu (for arm64 windows on Parallels enable wsl-1)
2. Install llama.cpp server on wsl into /home not /mnt to speed up loading:
```
cd ~
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
sudo apt update
sudo apt install python3-pip
python3 -m pip install -r requirements.txt
make -j
cp /mnt/c/Users/keithsiilats/Downloads/codellama-7b.Q4_0.gguf models
./server -m models/codellama-7b.Q4_0.gguf -c 2048
```

<!-- Plugin description end -->
39 changes: 39 additions & 0 deletions gradle.2023.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = ee.carlrobert
pluginName = CodeGPT
pluginRepositoryUrl = https://github.com/carlrobertoh/CodeGPT
# SemVer format -> https://semver.org
pluginVersion = 2.1.6

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 231
pluginUntilBuild = 232.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 2023.1

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins =

javaVersion = 17

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 7.6

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false
org.gradle.jvmargs=-Xmx812m "-XX:MaxMetaspaceSize=584m"
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache = true

# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true

# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
systemProp.org.gradle.unsafe.kotlin.assignment = true

# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom
kotlin.incremental.useClasspathSnapshot = false
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gradleVersion = 7.6

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false

org.gradle.jvmargs=-Xmx812m "-XX:MaxMetaspaceSize=584m"
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache = true

Expand All @@ -36,4 +36,4 @@ org.gradle.caching = true
systemProp.org.gradle.unsafe.kotlin.assignment = true

# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom
kotlin.incremental.useClasspathSnapshot = false
kotlin.incremental.useClasspathSnapshot = false
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private JComponent withEmptyLeftBorder(JComponent component) {
}

private String getHost(int port) {
return format("http://localhost:%d/completions", port);
return format("http://localhost:%d/completion", port);
}

private boolean isModelExists(HuggingFaceModel model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void apply() {
llamaSettings.setHost(serviceSelectionForm.getLlamaServerHost());
} else {
llamaSettings.setHost(format(
"http://localhost:%d/completions",
"http://localhost:%d/completion",
serviceSelectionForm.getLlamaServerPort()));
}
llamaSettings.setOverrideHost(serviceSelectionForm.isOverrideLamaServerHost());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private boolean isValidEmail(String email) {

private JTextPane createSignUpTextPane() {
var textPane = createTextPane(
"<html><a href=\"https://you.com/code\">Don't have an account? Sign up</a></html>");
"<html><a href=\"https://you.com/code\">Don't have an account? Sign up with 'CodeGPT' coupon for free GPT4</a></html>");
textPane.setBorder(JBUI.Borders.emptyLeft(4));
return textPane;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class LlamaSettingsState implements PersistentStateComponent<LlamaSetting
private String llamaModelPath = "";
private HuggingFaceModel huggingFaceModel = HuggingFaceModel.CODE_LLAMA_7B_Q4_K_M;
private int serverPort = 8080;
private String host = format("http://localhost:%d/completions", serverPort);
private String host = format("http://localhost:%d/completion", serverPort);
private boolean overrideHost;

public LlamaSettingsState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ private boolean isRequestAllowed() {
if (SettingsState.getInstance().isUseYouService()) {
return true;
}
if (SettingsState.getInstance().isUseLlamaService()) {
return true;
}
return OpenAICredentialsManager.getInstance().isApiKeySet();
}

Expand Down Expand Up @@ -359,8 +362,8 @@ private void init() {
var gpt4ToggleButton = new OnOffButton();
var useGPT4Model = YouSettingsState.getInstance().isUseGPT4Model();
gpt4ToggleButton.setSelected(useGPT4Model);
gpt4ToggleButton.setOnText("GPT-4");
gpt4ToggleButton.setOffText("GPT-4");
gpt4ToggleButton.setOnText("GPT-4 Enabled");
gpt4ToggleButton.setOffText("GPT-4 - 'CodeGPT' @ you.com/plans");
gpt4ToggleButton.addActionListener(
actionEvent -> {
project.getMessageBus()
Expand Down Expand Up @@ -388,7 +391,7 @@ private void init() {

private void installHelpTooltip(boolean selected, JComponent component) {
new HelpTooltip()
.setDescription(selected ? "Turn off for faster responses" : "Turn on for complex queries")
.setDescription(selected ? "Turn off for faster responses" : "Turn on for complex queries, enable by creating an account on you.com and signing in from plugin settings. Use CodeGPT coupon for free month of GPT4.")
.installOn(component);
}

Expand Down
Loading