Skip to content
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

Feature/hybrid node #188

Open
wants to merge 101 commits into
base: production
Choose a base branch
from

Conversation

MahdiPresario001
Copy link
Collaborator

@MahdiPresario001 MahdiPresario001 commented Dec 11, 2024

  • renamed query_node to synthetic_node + removed organic queries bit from it
  • renamed entry_node to organic_node + replace redis bit with the usage of the same functions used by synthetic_node
  • moved those steaming/nonstreaming functions onto a new "common" folder, used by synth_node & organic_node
  • added keypair loading via secret seed via env var
  • exposed redis/psql ports in order to be able to reach from outside

validator/organic_node/src/endpoints/text.py Show resolved Hide resolved
if chat_request.stream:
return StreamingResponse(generator, media_type="text/event-stream")
else:
return await _handle_nonstream_response(generator)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate minimal functions like _handle_no_stream and _handle_no_stream_comp as in latest prod would be more appropriate for /v1/completions and /v1/chat/completions routes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_handle_no_stream and _handle_no_stream_comp have a lot of the same code that's why i put it in one function directly

docker compose rm -f -v grafana
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@@ -22,6 +23,8 @@ services:
container_name: nineteen-otel-collector
image: otel/opentelemetry-collector-contrib:0.106.1
restart: always
ports:
- "4317:4317"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why exactly is this required just to confirm? to connect organic node running outside docker network?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for organic nodes on render (redis too)


logger = get_logger(__name__)

def load_hotkey_keypair_from_seed(secret_seed: str) -> Keypair:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a util really


T = TypeVar("T", bound=BaseModel)

load_dotenv()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt it .vali.env?

except Exception as e:
raise ValueError(f"Failed to load keypair: {str(e)}")

def create_redis_pool(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be priv method


_config = None

async def factory_config():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need separate functions for this, one can do both jobs

choice = chunk_data["choices"][0]

if first_chunk:
if "delta" in choice:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loads of magic strings here which are very dangerous. Why?

Was this unchanged from before or all new? If new, how come?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants