{"id":28463805,"url":"https://github.com/with-caer/curtana","last_synced_at":"2025-10-12T23:02:11.661Z","repository":{"id":295883247,"uuid":"991069001","full_name":"with-caer/curtana","owner":"with-caer","description":"Simplified zero-cost wrapper over llama.cpp powered by the lama-cpp-2 Crate.","archived":false,"fork":false,"pushed_at":"2025-07-10T00:53:51.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T10:13:33.978Z","etag":null,"topics":["crate","embedding-models","llama","llm-inference","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/with-caer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2025-05-27T04:47:07.000Z","updated_at":"2025-07-10T00:53:55.000Z","dependencies_parsed_at":"2025-05-27T21:44:39.231Z","dependency_job_id":"9f68fd11-a3ec-4119-a967-9b1fe576f5c5","html_url":"https://github.com/with-caer/curtana","commit_stats":null,"previous_names":["with-caer/curtana"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/with-caer/curtana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/with-caer%2Fcurtana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/with-caer%2Fcurtana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/with-caer%2Fcurtana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/with-caer%2Fcurtana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/with-caer","download_url":"https://codeload.github.com/with-caer/curtana/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/with-caer%2Fcurtana/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266680286,"owners_count":23967791,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["crate","embedding-models","llama","llm-inference","rust"],"created_at":"2025-06-07T05:00:52.521Z","updated_at":"2025-10-12T23:02:11.571Z","avatar_url":"https://github.com/with-caer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![`curtana` on crates.io](https://img.shields.io/crates/v/curtana)](https://crates.io/crates/curtana)\n[![`curtana` on docs.rs](https://img.shields.io/docsrs/curtana)](https://docs.rs/curtana/)\n[![`curtana` is MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/with-caer/curtana/blob/main/LICENSE.txt)\n\nAn accessible low-overhead wrapper over [`llama.cpp`](https://github.com/ggml-org/llama.cpp)\npowered by [`llama-cpp-2`](https://github.com/utilityai/llama-cpp-rs/tree/main), supporting\nmost `.gguf`-formatted \"Chat\" and \"Embedding\" models.\n\n## Examples\n\nThese examples assume the following models are downloaded into the working directory:\n\n- [`Llama-3.2-3B-Instruct-Q6_K.gguf`](https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q6_K.gguf)\n- [`nomic-embed-text-v1.5.f16.gguf`](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.f16.gguf)\n\n### Chat (via [Llama 3.2 Instruct](https://huggingface.co/bartowski/Llama-3.2-3B-Instruct-GGUF))\n\n```rust\n// Create a new local model registry and load\n// a chat model into it with a system prompt\n// of \"You are a cupcake.\"\nlet registry = ModelRegistry::new().unwrap();\nlet mut model = registry\n    .load_chat_model(\"Llama-3.2-3B-Instruct-Q6_K.gguf\", \"You are a cupcake.\")\n    .unwrap();\n\n// Run (\"infer\") the model with the prompt\n// \"What are you?\", capturing its output\n// as UTF-8 encoded bytes.\nlet mut output = vec![];\nmodel.infer(\"What are you?\", \u0026mut output).unwrap();\nlet output = String::from_utf8_lossy(\u0026output);\n\n// Hopefully, the model thinks it's a cupcake due\n// to the system prompt.\nassert!(output.to_lowercase().contains(\"cupcake\"));\n```\n\n### Embedding (via [Nomic Embedding 1.5](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF))\n\n```rust\n// Create a new local model registry and load\n// an embedding model into it.\nlet registry = ModelRegistry::new().unwrap();\nlet mut model = registry\n    .load_text_embedding_model(\"nomic-embed-text-v1.5.f16.gguf\")\n    .unwrap();\n\n// Embed some fanciful document titles with the model.\nlet embeddings = model\n    .embed(\u0026[\n        \"search_document: might and magic in fantasy realms\",\n        \"search_document: swords and sorcery for fantasy authors\",\n        \"search_document: practical engineering for scientists\",\n    ])\n    .unwrap();\nassert_eq!(3, embeddings.len());\n\n// Embed a search query with the model.\nlet query_embeddings = model.embed(\u0026[\"query_document: fantasy\"]).unwrap();\nassert_eq!(1, query_embeddings.len());\n\n// Calculate the cosine distance (or \"similarity\") between the embeddings.\nlet distance_a = cosine_distance(\u0026query_embeddings[0], \u0026embeddings[0]);\nlet distance_b = cosine_distance(\u0026query_embeddings[0], \u0026embeddings[1]);\nlet distance_c = cosine_distance(\u0026query_embeddings[0], \u0026embeddings[2]);\n\n// The fantasy embeddings should be more similar\n// than the scientific embedding.\nassert!(distance_a \u003c distance_c);\nassert!(distance_b \u003c distance_c);\n```\n\n## License\n\nCopyright © 2025 With Caer, LLC.\n\nLicensed under the MIT license. Refer to [the license file](https://github.com/with-caer/curtana/blob/main/LICENSE.txt) for more info.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwith-caer%2Fcurtana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwith-caer%2Fcurtana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwith-caer%2Fcurtana/lists"}