{"id":22164380,"url":"https://github.com/atelierarith/docstringtranslationollamabackend.jl","last_synced_at":"2025-10-14T15:44:27.485Z","repository":{"id":263214619,"uuid":"889696665","full_name":"AtelierArith/DocstringTranslationOllamaBackend.jl","owner":"AtelierArith","description":"DocstringTranslation using Ollama","archived":false,"fork":false,"pushed_at":"2025-07-18T01:07:13.000Z","size":198,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T12:25:08.250Z","etag":null,"topics":["julia","julialang","ollama","translation","translator"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtelierArith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"terasakisatoshi"}},"created_at":"2024-11-17T01:23:15.000Z","updated_at":"2025-07-18T01:07:17.000Z","dependencies_parsed_at":"2024-12-18T09:26:32.904Z","dependency_job_id":"fbab11ec-8c37-4df4-b1a8-4e52f1d52bef","html_url":"https://github.com/AtelierArith/DocstringTranslationOllamaBackend.jl","commit_stats":null,"previous_names":["atelierarith/docstringtranslationollamabackend.jl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AtelierArith/DocstringTranslationOllamaBackend.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringTranslationOllamaBackend.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringTranslationOllamaBackend.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringTranslationOllamaBackend.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringTranslationOllamaBackend.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtelierArith","download_url":"https://codeload.github.com/AtelierArith/DocstringTranslationOllamaBackend.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FDocstringTranslationOllamaBackend.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012191,"owners_count":26085079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["julia","julialang","ollama","translation","translator"],"created_at":"2024-12-02T05:07:14.292Z","updated_at":"2025-10-12T17:31:48.526Z","avatar_url":"https://github.com/AtelierArith.png","language":"Julia","funding_links":["https://github.com/sponsors/terasakisatoshi"],"categories":[],"sub_categories":[],"readme":"# DocstringTranslationOllamaBackend.jl\n\n## Description\n\nThis Julia package inserts Large Language Model (LLM) hooks into the API in the `Base.Docs module`, giving non-English speaking users the opportunity to help smooth API comprehension.\n\n## Prerequisite\n\n### Install Julia\n\nInstall Julia using juliaup.\n\n```sh\n$ curl -fsSL https://install.julialang.org | sh -s -- --yes\n```\n\n### Ollama\n\nThis package utilizes [Ollama](https://ollama.com/)\nNavigate to https://ollama.com/download and follow the instruction. Once it has been installed, we can use `ollama` command. Let's run `ollama --version`\n\n```sh\n$ ollama --version\nollama version is 0.4.2\n```\n\nBy default, We use local LLM model as [gemma2:9b](https://ollama.com/library/gemma2:9b). Therefore, please pull the model in advance. Namely:\n\n```sh\n$ ollama pull gemma2:9b\n```\n\n## Usage\n\nStart Julia REPL\n\n```sh\n$ cd path/to/directory\n$ julia\n               _\n   _       _ _(_)_     |  Documentation: https://docs.julialang.org\n  (_)     | (_) (_)    |\n   _ _   _| |_  __ _   |  Type \"?\" for help, \"]?\" for Pkg help.\n  | | | | | | |/ _` |  |\n  | | |_| | | | (_| |  |  Version 1.11.1 (2024-10-16)\n _/ |\\__'_|_|_|\\__'_|  |  Official https://julialang.org/ release\n|__/                   |\n\njulia\u003e using Pkg; Pkg.activate(\".\"); Pkg.instantiate()\n\njulia\u003e using DocstringTranslationOllamaBackend\n[ Info: Launching ollama with \"ollama ls\" command\n[ Info: Done\n```\n\nCall `@switchlang!` macro with your preferred language.\n\n### Example: Japanese(日本語)\n\n```julia\njulia\u003e @switchlang! :Japanese\n\nhelp?\u003e sin\nsearch: sin sinc sind sinh sign asin in min sinpi using isinf\n\n  sin(x)\n\n  x (ラジアンで表された値) の正弦を計算します。\n\n  sind、sinpi、sincos、cis、asin も参照してください。\n\n  例\n  ≡≡\n\n  julia\u003e round.(sin.(range(0, 2pi, length=9)'), digits=3)\n  1×9 Matrix{Float64}:\n   0.0  0.707  1.0  0.707  0.0  -0.707  -1.0  -0.707  -0.0\n\n  julia\u003e sind(45)\n  0.7071067811865476\n\n  julia\u003e sinpi(1/4)\n  0.7071067811865475\n\n  julia\u003e round.(sincos(pi/6), digits=3)\n  (0.5, 0.866)\n\n  julia\u003e round(cis(pi/6), digits=3)\n  0.866 + 0.5im\n\n  julia\u003e round(exp(im*pi/6), digits=3)\n  0.866 + 0.5im\n\n  ─────────────────────────────────────────────────────────────\n\n  sin(A::AbstractMatrix)\n\n  正方行列 A のマトリックスサインを計算します。\n\n  A が対称行列またはエルミート行列であれば、固有値分解 (eigen)\n  が使用して sine を計算します。それ以外の場合は、exp\n  を呼び出すことで sine を決定します。\n\n  例\n  ≡≡\n\n  julia\u003e sin(fill(1.0, (2,2)))\n  2×2 Matrix{Float64}:\n   0.454649  0.454649\n   0.454649  0.454649\n\njulia\u003e\n```\n\n### Example: German(ドイツ語)\n\n```julia\nhelp?\u003e sin\nsearch: sin sinc sind sinh sign asin in min sinpi using isinf\n\n  sin(x)\n\n  Berechnung des Sinus von x, wobei x in Radians liegt.\n\n  Siehe auch sind, sinpi, sincos, cis, asin.\n\n  Beispiele\n  ≡≡≡≡≡≡≡≡≡\n\n  julia\u003e round.(sin.(range(0, 2pi, length=9)'), digits=3)\n  1×9 Matrix{Float64}:\n   0.0  0.707  1.0  0.707  0.0  -0.707  -1.0  -0.707  -0.0\n\n  julia\u003e sind(45)\n  0.7071067811865476\n\n  julia\u003e sinpi(1/4)\n  0.7071067811865475\n\n  julia\u003e round.(sincos(pi/6), digits=3)\n  (0.5, 0.866)\n\n  julia\u003e round(cis(pi/6), digits=3)\n  0.866 + 0.5im\n\n  julia\u003e round(exp(im*pi/6), digits=3)\n  0.866 + 0.5im\n\n  ─────────────────────────────────────────────────────────────\n\n  sin(A::AbstractMatrix)\n\n  Berechnet die Matrix-Sinus von einer quadratischen Matrix A.\n\n  Wenn A symmetrisch oder hermitesch ist, wird ihre\n  Eigenwertzerlegung (eigen) verwendet, um den Sinus zu\n  berechnen. Andernfalls wird der Sinus durch einen Aufruf von\n  exp bestimmt.\n\n  Beispiele\n  ≡≡≡≡≡≡≡≡≡\n\n  julia\u003e sin(fill(1.0, (2,2)))\n  2×2 Matrix{Float64}:\n   0.454649  0.454649\n   0.454649  0.454649\n\njulia\u003e\n```\n\n### Back to English(英語)\n\nYou can revert the default `@doc` functionality anytime. Just call `@revertlang!` macro.\n\n```julia\njulia\u003e @revertlang!\n\nhelp?\u003e sin\nsearch: sin sinc sind sinh sign asin in min sinpi using isinf\n\n  sin(x)\n\n  Compute sine of x, where x is in radians.\n\n  See also sind, sinpi, sincos, cis, asin.\n\n  Examples\n  ≡≡≡≡≡≡≡≡\n\n  julia\u003e round.(sin.(range(0, 2pi, length=9)'), digits=3)\n  1×9 Matrix{Float64}:\n   0.0  0.707  1.0  0.707  0.0  -0.707  -1.0  -0.707  -0.0\n\n  julia\u003e sind(45)\n  0.7071067811865476\n\n  julia\u003e sinpi(1/4)\n  0.7071067811865475\n\n  julia\u003e round.(sincos(pi/6), digits=3)\n  (0.5, 0.866)\n\n  julia\u003e round(cis(pi/6), digits=3)\n  0.866 + 0.5im\n\n  julia\u003e round(exp(im*pi/6), digits=3)\n  0.866 + 0.5im\n\n  ─────────────────────────────────────────────────────────────\n\n  sin(A::AbstractMatrix)\n\n  Compute the matrix sine of a square matrix A.\n\n  If A is symmetric or Hermitian, its eigendecomposition\n  (eigen) is used to compute the sine. Otherwise, the sine is\n  determined by calling exp.\n\n  Examples\n  ≡≡≡≡≡≡≡≡\n\n  julia\u003e sin(fill(1.0, (2,2)))\n  2×2 Matrix{Float64}:\n   0.454649  0.454649\n   0.454649  0.454649\n\njulia\u003e\n```\n\n## Switching to another LLM.\n\nOn machines without a GPU accelerator, one may want to switch to another lightweight model, such as `gemma2:2b`. However, the translation accuracy will be reduced.\n\n```julia\njulia\u003e using Pkg; Pkg.activate(\".\")\njulia\u003e using DocstringTranslationOllamaBackend\njulia\u003e switchmodel!(\"gemma2:2b\")\n```\n\nTo improve translation accuracy, we can use `gemma2:27b`.\n\n```julia\njulia\u003e using Pkg; Pkg.activate(\".\")\njulia\u003e using DocstringTranslationOllamaBackend\njulia\u003e switchmodel!(\"gemma2:27b\")\n```\n\n### Other potential selections\n\n- [`mistral`](https://ollama.com/library/mistral)\n- [`gemma3:12b`](https://ollama.com/library/gemma3:12b), [`gemma3:27b`](https://ollama.com/library/gemma3:27b)\n\n## Acknowledgement\n\n- Ollama's basic streaming response implementation in Julia is based on this [tokugh/index(auto).md](https://gist.github.com/tokugh/497afc0f363727bd0b34456807fb8a32).\n- Ollama's HTTP request implementation is based on [ollama/ollama-python](https://github.com/ollama/ollama-python).\n\n## Appendix\n\nNormally `@doc mod::Module` reads the `README.md` of a given module `mod`. If the README.md contains many sentences, we have to wait a long time, even on GPU-enabled machines. Here, we use a `stream=true` option to make Julia show us real-time processing. As an example, try the following command:\n\n```julia\njulia\u003e using LatticeQCD; using DocstringTranslationOllamaBackend; @switchlang! :Japanese; @doc LatticeQCD; @revertlang!; @doc LatticeQCD\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatelierarith%2Fdocstringtranslationollamabackend.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatelierarith%2Fdocstringtranslationollamabackend.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatelierarith%2Fdocstringtranslationollamabackend.jl/lists"}