Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spirizeon/kazama
🍬 wrapper for the Ollama API, written in Rust
https://github.com/spirizeon/kazama
Last synced: 17 days ago
JSON representation
🍬 wrapper for the Ollama API, written in Rust
- Host: GitHub
- URL: https://github.com/spirizeon/kazama
- Owner: Spirizeon
- License: mit
- Created: 2024-07-09T14:55:54.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-17T13:22:54.000Z (4 months ago)
- Last Synced: 2024-10-15T14:21:55.705Z (24 days ago)
- Language: Rust
- Homepage: https://crates.io/crates/kazama/
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kazama
### Ollama Client in Rust 🦀
🤖 Rust client library for interacting with the Ollama API, enabling operations like chat completions, model pulls, embeddings generation, model listing, and model pushes.## ✅ **Features:**
- Chat Completion: `chat_completion(model, content, role)`
- Model Pull: `pull_model(name, stream_mode)`
- Generate Embeddings: `gen_embeddings(model, prompt)`
- List Models: `list_models()`
- Push Models: `push_models(name, stream_mode)`## ✅ **Usage:**
```rust
use kazama::{chat_completion, pull_model, gen_embeddings, list_models, push_models};#[tokio::main]
async fn main() {
// Example: Chat Completion
chat_completion("model_name", "Hello!", "user").await.expect("Failed to complete chat");// Example: Model Pull
pull_model("model_name", false).await.expect("Failed to pull model");// Example: Generate Embeddings
gen_embeddings("model_name", "Generate embeddings from this prompt").await.expect("Failed to generate embeddings");// Example: List Models
list_models().await.expect("Failed to list models");// Example: Push Models
push_models("model_name", true).await.expect("Failed to push model");
}
```For detailed API documentation, refer [here](https://crates.io/crates/kazama/).
Acknowledgement for icon: https://www.artstation.com/artwork/n0q6Ye