-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy APIs for making calls to models #3
Labels
enhancement
New feature or request
Comments
simonw
added a commit
that referenced
this issue
Nov 14, 2024
With curl http://localhost:8002/-/llm/chat -XPOST -d '{"prompt": "two names for a duck", "model": "claude-3-haiku"}' | jq Outputs: {
"prompt": "two names for a duck",
"response": "Here are two common names for a duck:\n\n1. Mallard\n2. Quack\n\nMallard is a specific species of duck, the most common and widespread type of wild duck. Quack is a generic term used to refer to ducks in general, based on the distinctive quacking sound they make.\n\nSome other names for ducks include:\n\n- Drake (male duck)\n- Hen (female duck)\n- Duckling (baby duck)\n- Waterfowl\n- Dabbler\n- Diving duck\n- Puddle duck\n\nBut \"mallard\" and \"quack\" are two of the most recognizable and commonly used names when referring to ducks.",
"details": {
"id": "msg_01QTfyra7jGXU8PFxaFT4SZB",
"content": [
{
"text": "Here are two common names for a duck:\n\n1. Mallard\n2. Quack\n\nMallard is a specific species of duck, the most common and widespread type of wild duck. Quack is a generic term used to refer to ducks in general, based on the distinctive quacking sound they make.\n\nSome other names for ducks include:\n\n- Drake (male duck)\n- Hen (female duck)\n- Duckling (baby duck)\n- Waterfowl\n- Dabbler\n- Diving duck\n- Puddle duck\n\nBut \"mallard\" and \"quack\" are two of the most recognizable and commonly used names when referring to ducks.",
"type": "text"
}
],
"model": "claude-3-haiku-20240307",
"role": "assistant",
"stop_reason": "end_turn",
"stop_sequence": null,
"type": "message",
"usage": {
"input_tokens": 12,
"output_tokens": 155
}
}
} Without |
API keys are currently picked up from environment variables or |
simonw
added a commit
that referenced
this issue
Nov 14, 2024
That streaming API seems to work: curl http://localhost:8002/-/llm/stream -XPOST \
-d '{"prompt": "two names for a duck with lengthy explanations", "model": "claude-3.5-sonnet"}' \
--no-buffer
|
simonw
changed the title
Proxy API that allows models to be called
Proxy APIs for making calls to models
Nov 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using new async support from this release:
I'm going to have two - one streaming and one non-streaming. Main purpose of these is to implement hidden API keys, and later to implement token accounting.
The text was updated successfully, but these errors were encountered: