mirror of
				https://github.com/amithkoujalgi/ollama4j.git
				synced 2025-11-03 18:10:42 +01:00 
			
		
		
		
	- Replaced instances of `OllamaAPI` with `Ollama` across the codebase for consistency. - Updated example code snippets in documentation to reflect the new class name. - Enhanced metrics collection setup in the documentation. - Added integration tests for the new `Ollama` class to ensure functionality remains intact.
		
			
				
	
	
	
		
			594 B
		
	
	
	
	
	
	
	
			
		
		
	
	
			594 B
		
	
	
	
	
	
	
	
sidebar_position
| sidebar_position | 
|---|
| 3 | 
Basic Auth
This API lets you set the basic authentication for the Ollama client. This would help in scenarios where Ollama server would be setup behind a gateway/reverse proxy with basic auth.
After configuring basic authentication, all subsequent requests will include the Basic Auth header.
import io.github.ollama4j.Ollama;
public class Main {
    public static void main(String[] args) {
        String host = "http://localhost:11434/";
        Ollama ollama = new Ollama(host);
        ollama.setBasicAuth("username", "password");
    }
}