{"id":3790,"date":"2023-09-12T14:05:41","date_gmt":"2023-09-12T19:05:41","guid":{"rendered":"https:\/\/fgiasson.com\/blog\/?p=3790"},"modified":"2023-09-12T14:07:28","modified_gmt":"2023-09-12T19:07:28","slug":"readnext-0-0-4-local-embedding-model","status":"publish","type":"post","link":"https:\/\/fgiasson.com\/blog\/index.php\/2023\/09\/12\/readnext-0-0-4-local-embedding-model\/","title":{"rendered":"ReadNext 0.0.4: Local Embedding Model"},"content":{"rendered":"\n<p>I just release <a href=\"https:\/\/pypi.org\/project\/readnext\/0.0.4\/\">ReadNext version 0.0.4<\/a>. The primary goal of this new version is to remove the dependency on the Cohere Embedding web service endpoint by using a local embedding model by default. To enable that, ReadNext got integrated with Hugging Face and is currently uses the <a href=\"https:\/\/huggingface.co\/BAAI\/bge-base-en\">BAAI\/bge-base-en<\/a> model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Local vs. Remote<\/h2>\n\n\n\n<p>This new change remove dependency on one external service which makes it more stable. The processing time is a little bit longer with the local model, but it also depends on the capabilities of your local computer.<\/p>\n<p>In terms of performance, <span> the two systems are comparable. In my experience, about 80% of the propositions are the same, and the remaining 20% that are different yeld no major difference in accuracy. However, I do prefer the <\/span><code>BAAI\/bge-base-en<\/code><span> propositions a little better for what I experienced so far.<\/span><\/p>\n<p>You may want to experiment with both to see what works best for you. The only thing you have to do is to change the <code>EMBEDDING_SYSTEM<\/code> environment variable and to reload your terminal instance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">New Configurations<\/h2>\n\n\n\n<p>Two new configuration options have been added to this version:<\/p>\n<ol>\n<li><span><code>EMBEDDING_SYSTEM<\/code>: This is the embedding system you want to use. One of: <code>BAAI\/bge-base-en<\/code>(local) or <code>cohere<\/code>.<\/span><\/li>\n<li><span><code>MODELS_PATH<\/code>: This is the local path where you want the models files to be saved on your local file system (ex: <code>\/Users\/me\/.readnext\/models\/<\/code>)<\/span><\/li>\n<\/ol>\n<p>If you already have ReadNext installed on your computer, please make sure to add those two new environment variables to you environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">New Commands<\/h2>\n\n\n\n<p>Two new commands have been added as well. They have been added to help understanding the current status of the ReadNext tool. Those two commands are:<\/p>\n<ol>\n<li><code>readnext version<\/code>: this gives the version of ReadNext that you are currently using<\/li>\n<li><code>readnext config<\/code>: this gives the configuration parameters, and their values, currently used to run that instance of ReadNext<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Literate Programming<\/h2>\n\n\n\n<p>While at it, I decided to migrate ReadNext&#8217;s Python codebase to use\u00a0<a href=\"https:\/\/fgiasson.com\/blog\/index.php\/2023\/08\/30\/literate-programming-in-python-using-nbdev\/\">nbdev<\/a> to continue its development using <a href=\"https:\/\/fgiasson.com\/blog\/index.php\/2023\/08\/28\/what-is-literate-programming-why\/\">literate programming<\/a>.\u00a0<\/p>\n<p>All the literate files (notebooks in this case) where the code is tangled and the documentation weaved from are accessible in the <a href=\"https:\/\/github.com\/fgiasson\/ReadNext\/tree\/main\/nbs\">nbs<\/a> folder. The tangled codebase is available in the\u00a0<a href=\"https:\/\/github.com\/fgiasson\/ReadNext\/tree\/main\/readnext\">readnext<\/a> folder. Finally, the weaved documentation is available as <a href=\"https:\/\/fgiasson.github.io\/ReadNext\/\">GitHub pages here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just release ReadNext version 0.0.4. The primary goal of this new version is to remove the dependency on the Cohere Embedding web service endpoint by using a local embedding model by default. To enable that, ReadNext got integrated with Hugging Face and is currently uses the BAAI\/bge-base-en model. Local vs. Remote This new change [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[293,277],"tags":[311,274,303],"class_list":["post-3790","post","type-post","status-publish","format-standard","hentry","category-artificial-intelligence","category-literate-programming","tag-huggingface","tag-literateprogramming","tag-readnext"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=3790"}],"version-history":[{"count":4,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3790\/revisions"}],"predecessor-version":[{"id":3794,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/3790\/revisions\/3794"}],"wp:attachment":[{"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=3790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=3790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fgiasson.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=3790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}