Skip to content

Commit

Permalink
Merge pull request #17 from mloncode/prepare-v0.0.1-release
Browse files Browse the repository at this point in the history
Prepare v0.0.1 release
  • Loading branch information
bzz authored Oct 20, 2023
2 parents a428958 + d173eff commit 9f82dc4
Show file tree
Hide file tree
Showing 24 changed files with 278 additions and 371 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.idea
.qodana
build
.venv
.DS_Store

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# intellij Changelog

## 0.0.1 - 2023-10-13
Internal hackathon version for IJ 2023.2

### Added
- Initial scaffold from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
- server.py, plugin for 2023.2 with ghost/inline code completion provider and a tool window


## [Unreleased]
### Added
- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
- ...
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
[![Version](https://img.shields.io/jetbrains/plugin/v/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID)

## Run model inference

To run OSS LLM use:
* a simple local [inference server](./server).



## Plugin development

Expand All @@ -15,7 +21,7 @@

- Using the IDE built-in plugin system:

<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "intellij"</kbd> >
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "OSS LLM"</kbd> >
<kbd>Install</kbd>

- Manually:
Expand All @@ -24,24 +30,20 @@
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>


### Template ToDo list
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
- [ ] Adjust the [pluginGroup](./gradle.properties), [plugin ID](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin).
- [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html?from=IJPluginTemplate).
- [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time.
- [ ] Set the `PLUGIN_ID` in the above README badges.
- [ ] Set the [Plugin Signing](https://plugins.jetbrains.com/docs/intellij/plugin-signing.html?from=IJPluginTemplate) related [secrets](https://github.com/JetBrains/intellij-platform-plugin-template#environment-variables).
- [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html?from=IJPluginTemplate).

<!-- Plugin description -->
Use Open Source LLMs for code completion in IDEs.
Use Open Source LLMs for code completion in IntelliJ IDEs.

Supported features
* Ghost/inline text completion
* Ghost text/inline code completion

<!-- Plugin description end -->


## Server

To runn OSS LLM inference server follow instructions in [./server].
### Template ToDo list
- [x] Create a new [IntelliJ Platform Plugin Template][template] project.
- [x] Adjust the [pluginGroup](./gradle.properties), [plugin ID](./src/main/resources/META-INF/plugin.xml) and [sources package](./src/main/kotlin).
- [x] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html?from=IJPluginTemplate).
- [ ] [Publish a plugin manually](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html?from=IJPluginTemplate) for the first time.
- [ ] Set the `PLUGIN_ID` in the above README badges.
- [ ] Set the [Plugin Signing](https://plugins.jetbrains.com/docs/intellij/plugin-signing.html?from=IJPluginTemplate) related [secrets](https://github.com/JetBrains/intellij-platform-plugin-template#environment-variables).
- [ ] Set the [Deployment Token](https://plugins.jetbrains.com/docs/marketplace/plugin-upload.html?from=IJPluginTemplate).
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
// alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
kotlin("plugin.serialization") version "1.9.10"
}
Expand Down Expand Up @@ -50,12 +50,12 @@ changelog {
}

// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
cachePath = provider { file(".qodana").canonicalPath }
reportPath = provider { file("build/reports/inspections").canonicalPath }
saveReport = true
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
}
//qodana {
// cachePath = provider { file(".qodana").canonicalPath }
// reportPath = provider { file("build/reports/inspections").canonicalPath }
// saveReport = true
// showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
//}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = com.github.bzz.intellij
pluginName = intellij
pluginGroup = org.intellij.ml
pluginName = llm
pluginRepositoryUrl = https://github.com/mloncode/intellij
# SemVer format -> https://semver.org
pluginVersion = 0.0.1

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

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
Expand Down
15 changes: 7 additions & 8 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Python server
Usage:

`python server.py [-p PORT] [-a HOSTNAME| address]`
Note: On macOS, MPS [requires](https://github.com/huggingface/transformers/issues/22502) Torch nightly.

Default address is `localhost`, default port is `8000`
Usage:

Call to API using curl:
`python server.py -p 8080 --model`

`curl -X POST [ADDRESS]:[PORT] --data "your_text_here"`

In response json in form `{"text": "another_text_here"}` will be returned.
Call the API using curl:

Example:
```sh
curl -X POST localhost:8080/generate --data "{ 'prompt': 'def ping_with_back_off():\n ' }"
```

`python server.py -p 8000 -a localhost`
89 changes: 0 additions & 89 deletions server/models/huggingface_models.py

This file was deleted.

26 changes: 26 additions & 0 deletions server/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
accelerate==0.23.0
bitsandbytes==0.41.1
certifi==2023.7.22
charset-normalizer==3.2.0
filelock==3.12.4
fsspec==2023.9.0
huggingface-hub==0.17.1
idna==3.4
Jinja2==3.1.2
MarkupSafe==2.1.3
mpmath==1.3.0
networkx==3.1
numpy==1.25.2
packaging==23.1
psutil==5.9.5
PyYAML==6.0.1
regex==2023.8.8
requests==2.31.0
safetensors==0.3.3
sympy==1.12
tokenizers==0.13.3
torch>=2.1.0
tqdm==4.66.1
transformers==4.33.1
typing_extensions==4.7.1
urllib3==2.0.4
Loading

0 comments on commit 9f82dc4

Please sign in to comment.