mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	server : add optional API Key Authentication example (#4441)
* Add API key authentication for enhanced server-client security * server : to snake_case --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
		| @@ -34,7 +34,8 @@ export async function* llama(prompt, params = {}, config = {}) { | ||||
|     headers: { | ||||
|       'Connection': 'keep-alive', | ||||
|       'Content-Type': 'application/json', | ||||
|       'Accept': 'text/event-stream' | ||||
|       'Accept': 'text/event-stream', | ||||
|       ...(params.api_key ? {'Authorization': `Bearer ${params.api_key}`} : {}) | ||||
|     }, | ||||
|     signal: controller.signal, | ||||
|   }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ShadovvBeast
					ShadovvBeast